Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import hudson.model.ParametersDefinitionProperty;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.queue.QueueTaskFuture;
import hudson.remoting.Channel;
import hudson.model.Slave;
import hudson.model.TaskListener;
Expand Down Expand Up @@ -183,14 +184,16 @@ public void abort() throws Exception {
"node {sh 'while true; do touch " + tmp + "; sleep 1; done'}", true));

// get the build going, and wait until workflow pauses
WorkflowRun b = foo.scheduleBuild2(0).getStartCondition().get();
final QueueTaskFuture<WorkflowRun> f = foo.scheduleBuild2(0);
WorkflowRun b = f.getStartCondition().get();

// at this point the file should be being touched
while (!Files.exists(tmp)) {
Thread.sleep(100);
}

b.getExecutor().interrupt();
b.doStop();
j.assertBuildStatus(Result.ABORTED, f.get());

// touching should have stopped
final long refTimestamp = Files.getLastModifiedTime(tmp).toMillis();
Expand All @@ -201,8 +204,6 @@ public void abort() throws Exception {
throw new UncheckedIOException(e);
}
});

j.assertBuildStatus(Result.ABORTED, j.waitForCompletion(b));
}

@Issue("JENKINS-41339")
Expand Down