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:
Tomas Babej 2020-12-06 12:00:34 -05:00
parent ee15bfa1db
commit 83f71520d2
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -51,7 +51,7 @@ class TestBug1999(TestCase):
self.t(("stop", "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):
@ -77,7 +77,7 @@ class TestBug1999Server(ServerTestCase):
self.t1("sync")
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")