Skip to content

Commit

Permalink
De-flake QueueTest#persistenceBlockedItem (#7476)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Dec 6, 2022
1 parent 6065ba9 commit b4772ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/src/test/java/hudson/model/QueueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
}
});

Future<FreeStyleBuild> b1 = p.scheduleBuild2(0);
FreeStyleBuild b1 = p.scheduleBuild2(0).waitForStart();
assertNotNull(b1);
seq.phase(1); // and make sure we have one build under way

Expand All @@ -280,6 +280,10 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
assertThat(items[0], instanceOf(BlockedItem.class));

q.save();

assertTrue(q.cancel(items[0]));
seq.done();
r.assertBuildStatusSuccess(r.waitForCompletion(b1));
}

public static final class FileItemPersistenceTestServlet extends HttpServlet {
Expand Down

0 comments on commit b4772ca

Please sign in to comment.