[Buildbot-commits] buildbot/buildbot/test runutils.py, 1.19, 1.20 test_slaves.py, 1.7, 1.8

Brian Warner warner at users.sourceforge.net
Tue Jul 3 02:22:21 UTC 2007


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

Modified Files:
	runutils.py test_slaves.py 
Log Message:
[project @ test_slaves.py: fix an intermittent failure, disappeared slaves were reconnecting]

Original author: warner at lothar.com
Date: 2007-07-03 02:21:43+00:00

Index: runutils.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/runutils.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- runutils.py	18 Jun 2007 02:52:49 -0000	1.19
+++ runutils.py	3 Jul 2007 02:22:19 -0000	1.20
@@ -206,6 +206,9 @@
         broker = bot.builders[buildername].remote.broker
         broker.dataReceived = discard # seal its ears
         broker.transport.write = discard # and take away its voice
+        # also discourage it from reconnecting once the connection goes away
+        assert self.slaves[slavename].bf.continueTrying
+        self.slaves[slavename].bf.continueTrying = False
 
     def ghostSlave(self):
         # the slave thinks it has lost the connection, and initiated a

Index: test_slaves.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_slaves.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- test_slaves.py	2 Jul 2007 17:50:17 -0000	1.7
+++ test_slaves.py	3 Jul 2007 02:22:19 -0000	1.8
@@ -128,10 +128,11 @@
         # claimed for the build, and that the failing one is removed from the
         # list.
 
+        b1 = self.master.botmaster.builders["b1"]
         # reduce the ping time so we'll failover faster
-        self.master.botmaster.builders["b1"].START_BUILD_TIMEOUT = 1
-        assert self.master.botmaster.builders["b1"].CHOOSE_SLAVES_RANDOMLY
-        self.master.botmaster.builders["b1"].CHOOSE_SLAVES_RANDOMLY = False
+        b1.START_BUILD_TIMEOUT = 1
+        assert b1.CHOOSE_SLAVES_RANDOMLY
+        b1.CHOOSE_SLAVES_RANDOMLY = False
         self.disappearSlave("bot1", "b1")
         d = self.doBuild("b1")
         d.addCallback(self._testFallback2_1)
@@ -140,9 +141,7 @@
         self.failUnlessEqual(res.getResults(), SUCCESS)
         self.failUnlessEqual(res.getSlavename(), "bot2")
         b1slaves = self.master.botmaster.builders["b1"].slaves
-        # TODO: this check fails sometimes, sometimes len(b1slaves)==2,
-        # sometimes it is empty
-        self.failUnlessEqual(len(b1slaves), 1, b1slaves)
+        self.failUnlessEqual(len(b1slaves), 1, "whoops: %s" % (b1slaves,))
         self.failUnlessEqual(b1slaves[0].slave.slavename, "bot2")
 
 





More information about the Commits mailing list