X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/a0ead2ba812735c2d1edd660b8608f8cb52cea5d..030723a851a8f8e34970a4c63dd8aaf7174c769e:/tests/dtest.py diff --git a/tests/dtest.py b/tests/dtest.py index 9439bce..5015c48 100644 --- a/tests/dtest.py +++ b/tests/dtest.py @@ -271,16 +271,10 @@ def create_user(username="fred", password="fredpass"): "--user", "root", "edituser", username, "rights", "all"]) def rescan(c=None): - class rescan_monitor(disorder.monitor): - def rescanned(self): - return False + print " initiating rescan" if c is None: c = disorder.client() - m = rescan_monitor() - print " initiating rescan" - c.rescan() - print " waiting for rescan to complete" - m.run() + c.rescan('wait') print " rescan completed" def stop_daemon(): @@ -300,6 +294,8 @@ Stop the daemon if it has not stopped already""" else: print " daemon already stopped" daemon = None + # Wait a bit for subprocess to finish too, to try to avoid stupid races + time.sleep(1) def run(module=None, report=True): """dtest.run(MODULE) @@ -319,6 +315,7 @@ def run(module=None, report=True): if type(module) == str: module = __import__(module) name = module.__name__ + print "--- %s ---" % name # Open the error log global errs logfile = "%s.log" % name