'L{DistTrialRunner} can run in C{untilFailure} mode where it will run
the given tests until they fail.'

def test_runUntilFailure(self):

    called = []
    class FakeReactorWithSuccess(FakeReactor, ):
        def spawnProcess(self, worker, *args, **kwargs):
            worker.makeConnection(FakeTransport())
            self.spawnCount += 1
            worker._ampProtocol.run = self.succeedingRun
        def succeedingRun(self, case, result):
            called.append(None)
            if (len(called) == 5):
                return fail(RuntimeError('oops'))
            return succeed(None)
    fakeReactor = FakeReactorWithSuccess()
    (scheduler, cooperator) = self.getFakeSchedulerAndEternalCooperator()
    result = self.runner.run(TestCase(), fakeReactor, cooperate=cooperator.cooperate, untilFailure=True)
    scheduler.pump()
    self.assertEqual(5, len(called))
    self.assertFalse(result.wasSuccessful())
    output = self.runner._stream.getvalue()
    self.assertIn('PASSED', output)
    self.assertIn('FAIL', output)
