From b61fa18616fbecae20bd0a5d74a08c6d5ffa3dcd Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 28 Jul 2023 17:36:10 +0200 Subject: [PATCH] Fix ``test_most_recently_used`` I see this failing about 50% of the time, and if it fails history1 and history2 have the same update time. --- test/unit/app/managers/test_HistoryManager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/app/managers/test_HistoryManager.py b/test/unit/app/managers/test_HistoryManager.py index 3944a118471..32be275d4db 100644 --- a/test/unit/app/managers/test_HistoryManager.py +++ b/test/unit/app/managers/test_HistoryManager.py @@ -1,3 +1,4 @@ +import time from unittest import mock import pytest @@ -337,6 +338,9 @@ class TestHistoryManager(BaseTestCase): history1 = self.history_manager.create(name="history1", user=user2) self.trans.set_history(history1) + + # sleep a tiny bit so update time for history2 is different from history1 + time.sleep(0.1) history2 = self.history_manager.create(name="history2", user=user2) self.log("should be able to get the most recently used (updated) history for a given user")