From 3c120eb7e6258dd39894009e419ef5c45deddec4 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Mon, 18 Aug 2003 23:22:27 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2141 --- test/testbase.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testbase.py b/test/testbase.py index 7ce91bfe4c..0d27dc83e5 100644 --- a/test/testbase.py +++ b/test/testbase.py @@ -322,9 +322,18 @@ class TestProject(Project): def run_init_wait(self): time.sleep(5) def run_finish_wait(self): + '''Sleep until all workunits are assimilated and no workunits need to transition. + + If more than X seconds have passed than just assume something is broken and return.''' + db = self.db_open() + timeout = time.time() + 3*60 while (num_wus_assimilated(db) < self.num_wu) or num_wus_to_transition(db): time.sleep(.5) + if time.time() > timeout: + error("run_finish_wait(): timed out waiting for workunits to assimilated/transition") + break + db.close() def check(self): verbose_sleep("Sleeping to allow server daemons to finish", 5)