Skip to content

Conversation

@hashar
Copy link
Contributor

@hashar hashar commented Nov 12, 2024

Before submitting a pull request, please make sure the following is done:

  1. Fork the repository and create your branch from master.
  2. If you've fixed a bug or added code that should be tested, please add JUnit tests.
  3. Ensure the test suite passes (mvn clean verify).
  4. Run mvn hpi:run and go to http://localhost:8080/jenkins/ to test your changes. Add a job that produces your bug / feature scenario.

@hashar
Copy link
Contributor Author

hashar commented Nov 12, 2024

The test fails somehow, I am running mvn compile -Dtest='PostBuildScriptIT#handlesInterruptedException' test and looking at the build console:
~~

Expected: a string containing "foo"
     but: was "Legacy code started this job.  No cause information is available
Running as SYSTEM
Building in workspace /home/hashar/projects/jenkinsci/postbuildscript-plugin/target/tmp/j h11551619371799314393/workspace/test0
[PostBuildScript] - [INFO] Executing post build scripts.
FATAL: class org.jenkinsci.plugins.postbuildscript.PostBuildScript is missing its descriptor
java.lang.AssertionError: class org.jenkinsci.plugins.postbuildscript.PostBuildScript is missing its descriptor
	at jenkins.model.Jenkins.getDescriptorOrDie(Jenkins.java:1651)
	at hudson.tasks.Publisher.getDescriptor(Publisher.java:125)
	at hudson.tasks.Notifier.getDescriptor(Notifier.java:54)
	at hudson.tasks.Notifier.getDescriptor(Notifier.java:48)
	at hudson.model.AbstractBuild$AbstractBuildExecution.getBuildStepName(AbstractBuild.java:853)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:831)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
	at hudson.model.Build$BuildExecution.post2(Build.java:179)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
	at hudson.model.Run.execute(Run.java:1917)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
Finished: FAILURE
"

~~
With mvn hpi:run, when using the parameterized trigger plugin, the build step is a job which can be waiting in the Jenkins build queue. If it gets cancelled that throws an InterruptedException and the console shows:
~~

Started by user unknown or anonymous
Running as SYSTEM
Building in workspace /home/hashar/projects/jenkinsci/postbuildscript-plugin/work/workspace/strict-upstream-project
[PostBuildScript] - [INFO] Executing post build scripts.
Waiting for the completion of [downstream-project](http://127.0.0.1:8080/jenkins/job/downstream-project/)
Build aborting: cancelling queued project [downstream-project](http://127.0.0.1:8080/jenkins/job/downstream-project/)
Build step 'Execute scripts' changed build result to ABORTED
Finished: ABORTED

~~
The job is described as Execute scripts. So my guess is the TestBuilder is missing something?

@hashar hashar force-pushed the handle-cancelled-steps branch 2 times, most recently from 4e1f18c to e28bbe7 Compare November 12, 2024 18:39
@hashar hashar force-pushed the handle-cancelled-steps branch from e28bbe7 to 6999c6e Compare November 13, 2024 09:51
@hashar hashar marked this pull request as ready for review November 13, 2024 09:58
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.

1 participant