")         def resultHandler = new TestResultHandler()          when:         withConnection { ProjectConnection connection ->             def build = connection.newBuild()             build.forTasks('hang')             build.withCancellationToken(cancel.token())             collectOutputs(build)             build.run(resultHandler)             sync.waitForAllPendingCalls(resultHandler)             cancel.cancel()             resultHandler.finished()         }          then:         