Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address how and where we end the AsynchronousExecution #3

Closed

Conversation

svanoort
Copy link

@svanoort svanoort commented Oct 4, 2018

Corrects for cases where the AsynchronousExecution could be left dangling inadvertently.

@jglick
Copy link
Owner

jglick commented Oct 4, 2018

As an amendment to jenkinsci#27.

@svanoort
Copy link
Author

svanoort commented Oct 4, 2018

Precisely.

Copy link
Owner

@jglick jglick left a comment

Choose a reason for hiding this comment

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

This is very close to what I had initially, and it does not work, as explained in 18d78f3.

Copy link
Owner

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks OK. Do tests pass with this?

}
} else if (execution == null) {
} else if (execution == null && completed != Boolean.TRUE) {
needsToPersist = true; // Make sure we save toggled state
Copy link
Owner

Choose a reason for hiding this comment

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

Not really related to changes in JEP-210, right?

Copy link
Author

Choose a reason for hiding this comment

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

Not as such, but more correcting for some issues in the logic.

@@ -580,6 +596,7 @@ private void finish(@Nonnull Result r, @CheckForNull Throwable t) {
setResult(r);
completed = Boolean.TRUE;
duration = Math.max(0, System.currentTimeMillis() - getStartTimeInMillis());

Copy link
Owner

Choose a reason for hiding this comment

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

could revert

@jglick
Copy link
Owner

jglick commented Oct 4, 2018

Passes for me, with some flakes such as

java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:86)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertFalse(Assert.java:64)
	at org.junit.Assert.assertFalse(Assert.java:74)
	at org.jenkinsci.plugins.workflow.job.WorkflowRunRestartTest.lambda$resumeDisabled$3(WorkflowRunRestartTest.java:101)

from

r.waitForCompletion(b);
assertFalse(b.executionLoaded); // here

which I suspect are due to a race condition between WorkflowRun.isBuilding and something else. But possibly a preëxisting condition?

@svanoort
Copy link
Author

svanoort commented Oct 4, 2018

@jglick Still sorting out some test oddities

@jglick
Copy link
Owner

jglick commented Oct 4, 2018

Still getting some flakes:

java.lang.AssertionError: expected:<1> but was:<0>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:834)
	at org.junit.Assert.assertEquals(Assert.java:645)
	at org.junit.Assert.assertEquals(Assert.java:631)
	at org.jenkinsci.plugins.workflow.job.WorkflowRunRestartTest.lambda$flowExecutionListener$11(WorkflowRunRestartTest.java:295)

and

java.lang.AssertionError: expected null, but was:<Owner[p/1:p #1]>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotNull(Assert.java:755)
	at org.junit.Assert.assertNull(Assert.java:737)
	at org.junit.Assert.assertNull(Assert.java:747)
	at org.jenkinsci.plugins.workflow.job.WorkflowRunRestartTest.lambda$lazyLoadExecution$5(WorkflowRunRestartTest.java:132)

@svanoort
Copy link
Author

svanoort commented Oct 4, 2018

For whatever reason, what should be a trivial fix is not, and oddly the original does not trigger failures (CI only for me, see to be locally irreproducible), so... I guess we roll with it.

@svanoort svanoort closed this Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants