Skip to content

Commit

Permalink
Fix test_most_recently_used
Browse files Browse the repository at this point in the history
I see this failing about 50% of the time, and if it fails history1 and
history2 have the same update time.
  • Loading branch information
mvdbeek committed Jul 28, 2023
1 parent 5066ead commit d94210b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/app/managers/test_HistoryManager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

Check failure on line 1 in test/unit/app/managers/test_HistoryManager.py

View workflow job for this annotation

GitHub Actions / Test (3.11)

Imports are incorrectly sorted and/or formatted.

from unittest import mock

import pytest
Expand Down Expand Up @@ -337,6 +339,9 @@ def test_most_recently_used(self):

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")
Expand Down

0 comments on commit d94210b

Please sign in to comment.