Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented May 23, 2023

No description provided.

@jglick jglick requested a review from a team as a code owner May 23, 2023 19:51
@jglick jglick added the tests label May 23, 2023

@Issue({"JENKINS-45585", "JENKINS-50784"}) // Verifies execution lazy-load
@Test public void lazyLoadExecution() {
story.thenWithHardShutdown(r -> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method does not exist in JenkinsSessionRule. Rarely needed; no apparent reason for it to have been added in #93.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…but need to revisit 18d78f3 from #27.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, have it. thenWithHardShutdown blocks FlowExecutionList.saveAll, and unregister saves asynchronously, so after a restart an attempt is made to load this supposedly running build and WorkflowRun.getExecution is called, which can cause the test to fail. Switching to then fixes this, as does simply sleeping momentarily.

@jglick jglick marked this pull request as draft May 23, 2023 20:51
@jglick jglick marked this pull request as ready for review May 23, 2023 21:43
@jglick jglick enabled auto-merge May 24, 2023 20:45
@jglick jglick merged commit 18c3137 into jenkinsci:master May 24, 2023
@jglick jglick deleted the WorkflowRunRestartTest branch May 24, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants