[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 117: If a test times out, try to kill it on the client. Reboot back to the

Message ID 20110922143715.25204.11711.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson Sept. 22, 2011, 2:37 p.m.
------------------------------------------------------------
revno: 117
fixes bug(s): https://launchpad.net/bugs/844446
committer: Paul Larson <paul.larson@canonical.com>
branch nick: stop-test-on-timeout
timestamp: Tue 2011-09-20 11:39:14 -0500
message:
  If a test times out, try to kill it on the client.  Reboot back to the
  test image if it doesn't get us back to a command prompt in a reasonable
  amount of time.
modified:
  lava_dispatcher/actions/lava-test.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription

Patch

=== modified file 'lava_dispatcher/actions/lava-test.py'
--- lava_dispatcher/actions/lava-test.py	2011-09-16 02:37:57 +0000
+++ lava_dispatcher/actions/lava-test.py	2011-09-20 16:39:14 +0000
@@ -85,7 +85,15 @@ 
         bundle_name = test_name + "-" + datetime.now().strftime("%H%M%S")
         cmd = ('lava-test run %s -o %s/%s.bundle' % (
                 test_name, self.context.lava_result_dir, bundle_name))
-        rc = client.run_cmd_tester(cmd, timeout=timeout)
+        try:
+            rc = client.run_cmd_tester(cmd, timeout=timeout)
+        except:
+            client.proc.sendcontrol('c')
+            try:
+                client.run_cmd_tester('true', timeout=20)
+            except:
+                client.boot_linaro_image()
+            raise
         if rc is None:
             raise OperationFailed("test case getting return value failed")
         elif rc != 0: