Merge "Re-enable TestScheduler.test_rerun_on_error" into feature/zuulv3
diff --git a/tests/base.py b/tests/base.py
index 02953f5..6d2c64d 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -758,6 +758,8 @@
         self.running_builds.remove(build)
         del self.job_builds[job.unique]
         self.lock.release()
+        if build.run_error:
+            result = None
         return result
 
 
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index bf5d56b..5f41c5d 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -2104,7 +2104,6 @@
         self.assertEqual(D.data['status'], 'MERGED')
         self.assertEqual(D.reported, 2)
 
-    @skip("Disabled for early v3 development")
     def test_rerun_on_error(self):
         "Test that if a worker fails to run a job, it is run again"
         self.launch_server.hold_jobs_in_build = True
diff --git a/zuul/launcher/server.py b/zuul/launcher/server.py
index 489869f..b831107 100644
--- a/zuul/launcher/server.py
+++ b/zuul/launcher/server.py
@@ -380,6 +380,9 @@
             job.sendWorkStatus(0, 100)
 
             result = self.runAnsible(jobdir, job)
+            if result is None:
+                job.sendWorkFail()
+                return
             result = dict(result=result)
             job.sendWorkComplete(json.dumps(result))