Skip to content

Commit 340e770

Browse files
author
Alexander Smishlajev
committed
testJournals: if backend is too fast, two journal entries...
...may come at the same millisecond. as a result, journal is sorted in wrong order and the test fails although functionality being tested is ok. add small delay to work around this - journaled actions rarely occur as frequent in the real life.
1 parent a42cc14 commit 340e770

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/db_test_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: db_test_base.py,v 1.49 2004-10-14 10:39:14 a1s Exp $
18+
# $Id: db_test_base.py,v 1.50 2004-10-14 10:47:07 a1s Exp $
1919

2020
import unittest, os, shutil, errno, imp, sys, time, pprint
2121

@@ -596,6 +596,8 @@ def testJournals(self):
596596
self.assertEqual('link', action)
597597
self.assertEqual(('issue', '1', 'assignedto'), params)
598598

599+
# wait a bit to keep proper order of journal entries
600+
time.sleep(0.01)
599601
# journal entry for unlink
600602
self.db.issue.set('1', assignedto='2')
601603
self.db.commit()

0 commit comments

Comments
 (0)