From ccb222a31be049fe6e3ef28fe660a1eaca351a95 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 6 Dec 2020 12:00:34 -0500 Subject: [PATCH] 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. --- test/tw-1999.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tw-1999.t b/test/tw-1999.t index fd72be44c..6ae83fe10 100755 --- a/test/tw-1999.t +++ b/test/tw-1999.t @@ -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")