[Buildbot-commits] buildbot/buildbot/test test_run.py,1.19,1.20

Brian Warner warner at users.sourceforge.net
Wed Dec 8 03:54:58 UTC 2004


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

Modified Files:
	test_run.py 
Log Message:
* buildbot/test/test_run.py (Disconnect.testBuild4): validate that
losing the slave in the middle of a remote step is handled too

* buildbot/process/step.py (ShellCommand.interrupt): 'reason' can
be a Failure, so be sure to stringify it before using it as the
contents of the 'interrupt' logfile
(RemoteCommand.interrupt): use stringified 'why' in
remote_interruptCommand too, just in case


Index: test_run.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_run.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- test_run.py	3 Dec 2004 22:54:53 -0000	1.19
+++ test_run.py	8 Dec 2004 03:54:56 -0000	1.20
@@ -374,6 +374,16 @@
 
         self.failUnlessEqual(bs.getResults(), builder.FAILURE)
 
+    def verifyDisconnect2(self, bs):
+        self.failUnless(bs.isFinished())
+
+        step1 = bs.getSteps()[1]
+        self.failUnlessEqual(step1.getText(), ["remote", "delay", "2 secs",
+                                               "failed", "slave", "lost"])
+        self.failUnlessEqual(step1.getResults()[0], builder.FAILURE)
+
+        self.failUnlessEqual(bs.getResults(), builder.FAILURE)
+
 
     def testIdle1(self):
         m,s,c,s1 = self.disconnectSetup()
@@ -450,6 +460,19 @@
         self.failUnlessEqual(s1.getState()[0], "offline")
         self.verifyDisconnect(bs)
 
+    def testBuild4(self):
+        m,s,c,s1 = self.disconnectSetup()
+        # this next sequence is timing-dependent
+        bc = c.getBuilder("dummy").forceBuild(None, "forced build")
+        bs = bc.getStatus()
+        # kill the slave while it's running the second (remote) step
+        reactor.callLater(1.5, self.killSlave)
+
+        dr(bs.waitUntilFinished(), 5)
+
+        self.failUnlessEqual(s1.getState()[0], "offline")
+        self.verifyDisconnect2(bs)
+
     def testInterrupt(self):
         m,s,c,s1 = self.disconnectSetup()
         # this next sequence is timing-dependent





More information about the Commits mailing list