[Buildbot-commits] buildbot/buildbot/test test_run.py,1.30,1.31

Brian Warner warner at users.sourceforge.net
Mon May 16 08:42:13 UTC 2005


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20152/buildbot/test

Modified Files:
	test_run.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-179
Creator:  Brian Warner <warner at monolith.lothar.com>

reduce timing-sensitivity of test_run.Status.testSlave

	* buildbot/test/test_run.py (Status.testSlave): be smarter about
	validating the ETA, so the tests don't fail on slow systems


Index: test_run.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- test_run.py	4 May 2005 06:44:31 -0000	1.30
+++ test_run.py	16 May 2005 08:42:10 -0000	1.31
@@ -466,6 +466,7 @@
         steps = b.getSteps()
         self.failUnlessEqual(len(steps), 2)
 
+        eta = 0
         st1 = steps[0]
         self.failUnlessEqual(st1.getName(), "dummy")
         self.failUnless(st1.isFinished())
@@ -474,6 +475,7 @@
         self.failUnless(0.5 < (finish-start) < 10)
         self.failUnlessEqual(st1.getExpectations(), [])
         self.failUnlessEqual(st1.getLogs(), [])
+        eta += finish-start
 
         st2 = steps[1]
         self.failUnlessEqual(st2.getName(), "remote dummy")
@@ -482,6 +484,7 @@
                              ["remote", "delay", "2 secs"])
         start,finish = st2.getTimes()
         self.failUnless(1.5 < (finish-start) < 10)
+        eta += finish-start
         self.failUnlessEqual(st2.getExpectations(), [('output', 38, None)])
         logs = st2.getLogs()
         self.failUnlessEqual(len(logs), 1)
@@ -498,7 +501,9 @@
         d = bc.getStatus().waitUntilFinished()
         res = dr(d)
 
-        self.failUnless(3.0 < t4.eta_build < 5.0) # should be 4 seconds
+        self.failUnless(eta-1 < t4.eta_build < eta+1, # should be 3 seconds
+                        "t4.eta_build was %g, not in (%g,%g)"
+                        % (t4.eta_build, eta-1, eta+1))
 
 class BuilderNames(unittest.TestCase):
 





More information about the Commits mailing list