tests: Make faketime tests less susceptible to race conditions
The duration can be 10:01 if the original task call happened a split second before the faketime fixation of +10 minutes. Use more relaxed regular expresison to check.
This commit is contained in:
@@ -51,7 +51,7 @@ class TestBug1999(TestCase):
|
|||||||
self.t(("stop", "1"))
|
self.t(("stop", "1"))
|
||||||
|
|
||||||
code, out, err = self.t(("info", "1"))
|
code, out, err = self.t(("info", "1"))
|
||||||
self.assertIn("duration: 0:10:00", out)
|
self.assertRegex(out, "duration: 0:10:0[0-5]")
|
||||||
|
|
||||||
|
|
||||||
class TestBug1999Server(ServerTestCase):
|
class TestBug1999Server(ServerTestCase):
|
||||||
@@ -77,7 +77,7 @@ class TestBug1999Server(ServerTestCase):
|
|||||||
self.t1("sync")
|
self.t1("sync")
|
||||||
|
|
||||||
code, out, err = self.t1(("info", "1"))
|
code, out, err = self.t1(("info", "1"))
|
||||||
self.assertIn("duration: 0:10:00", out)
|
self.assertRegex(out, "duration: 0:10:0[0-5]")
|
||||||
|
|
||||||
self.t2("sync")
|
self.t2("sync")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user