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

Update dependencies and stabilize tests #206

Merged
merged 4 commits into from Aug 24, 2023
Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Aug 23, 2023

Continuing #203 & #205, trying to stabilize the test suite here which is apparently loaded with cases of background activity of unclear timing.

Copy link
Member Author

@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.

I also noticed this plugin has several CRNL source files, which makes diffs weird.

pom.xml Outdated
<useBeta>true</useBeta>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
<!-- TODO pending inclusion in parent: -->
<jenkins-test-harness.version>2061.v04b_f07857801</jenkins-test-harness.version> <!-- TODO https://github.com/jenkinsci/jenkins-test-harness/pull/643 -->
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 337 to 338
FreeStyleBuild b = p.scheduleBuild2(0, new Cause.UserIdCause()).get();
rule.assertBuildStatusSuccess(b);
Copy link
Member Author

Choose a reason for hiding this comment

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

Leaving more complex multiline idioms for proper tooling: openrewrite/rewrite-jenkins#43

<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<org.jvnet.hudson.test.RemainingActivityListener.wait>true</org.jvnet.hudson.test.RemainingActivityListener.wait>
Copy link
Member Author

Choose a reason for hiding this comment

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

Example:

=== Starting testWithPermalinkBuildSelector(hudson.plugins.copyartifact.LastCompletedBuildSelectorTest)
   0.008 [id=102]	INFO	o.jvnet.hudson.test.JenkinsRule#createWebServer: Running on http://localhost:40519/jenkins/
   0.090 [id=115]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
   0.092 [id=132]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
   0.093 [id=116]	INFO	j.b.api.BouncyCastlePlugin#start: …/plugins/bouncycastle-api/WEB-INF/optional-lib not found; for non RealJenkinsRule this is fine and can be ignored.
   0.321 [id=123]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
   0.324 [id=136]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
   0.324 [id=118]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
   0.326 [id=136]	INFO	h.p.c.CopyArtifactConfiguration#load: CopyArtifact is set to Production mode.
   0.860 [id=125]	INFO	jenkins.InitReactorRunner$1#onAttained: System config loaded
   0.860 [id=121]	INFO	jenkins.InitReactorRunner$1#onAttained: System config adapted
   0.873 [id=126]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
   0.874 [id=126]	INFO	jenkins.InitReactorRunner$1#onAttained: Configuration for all jobs updated
   0.887 [id=127]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
   1.900 [id=153]	INFO	hudson.model.Run#execute: test0 #2 aborted
java.lang.InterruptedException: sleep interrupted
	at java.base/java.lang.Thread.sleep(Native Method)
	at org.jvnet.hudson.test.SleepBuilder.perform(SleepBuilder.java:51)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
	at hudson.model.Build$BuildExecution.build(Build.java:199)
	at hudson.model.Build$BuildExecution.doRun(Build.java:164)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526)
	at hudson.model.Run.execute(Run.java:1900)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
   1.901 [id=102]	WARNING	o.j.h.t.RemainingActivityListener#onTearDown: test0 #2 still seems to be running, which could break deletion of log files or metadata
   6.904 [id=102]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins
   6.920 [id=102]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped
   7.011 [id=102]	INFO	o.j.h.t.TemporaryDirectoryAllocator#dispose: deleting …

pointing to

as a possible source of instability in this test. It seems that
assertTrue(upstreamIncompleteBuild.isBuilding());
upstreamIncompleteBuild.getExecutor().interrupt();
attempts to abort it, but the actual build termination will occur a bit later…and, evidently, sometimes after the test method exits.

@jglick jglick marked this pull request as ready for review August 24, 2023 19:41
@jglick jglick requested a review from a team as a code owner August 24, 2023 19:41
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks!

@MarkEWaite MarkEWaite enabled auto-merge (rebase) August 24, 2023 19:47
@MarkEWaite MarkEWaite changed the title Update deps Update dependencies and stabilize tests Aug 24, 2023
@MarkEWaite MarkEWaite merged commit 0662a9b into jenkinsci:master Aug 24, 2023
17 checks passed
@jglick jglick deleted the bumps branch August 24, 2023 20:01
@basil
Copy link
Member

basil commented Aug 25, 2023

Is org.jvnet.hudson.test.RemainingActivityListener.wait not just a temporary workaround though?

@jglick
Copy link
Member Author

jglick commented Aug 25, 2023

Until someone finds the time to go through the tests in this plugin and clean them up.

@basil
Copy link
Member

basil commented Aug 25, 2023

Mmm, "someone."

@basil
Copy link
Member

basil commented Aug 25, 2023

I would personally not have approved this PR.

Comment on lines +35 to +36
<!-- TODO pending inclusion in parent: -->
<jenkins-test-harness.version>2062.v3efc79721e45</jenkins-test-harness.version>
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants