jenkinsci / build-timeout-plugin

Jenkins build-timeout plugin
https://plugins.jenkins.io/build-timeout/
31 stars 80 forks source link

Third attempt at fixing logging problem for Matrix jobs #106

Closed krisstern closed 1 year ago

krisstern commented 1 year ago

Description

Third attempt to attempt to resolve #100. Got rid of the ClassCastException now that the timeOutFor() for the global timeout is overloaded for both the AbstractProject and AbstractBuild classes.

Checklist

Pesa commented 1 year ago

@krisstern I suspect this change broke all matrix builds on our instance. It was fine before upgrading the plugin to 1.27.

FATAL: class hudson.matrix.MatrixProject cannot be cast to class hudson.model.Project (hudson.matrix.MatrixProject is in unnamed module of loader jenkins.util.URLClassLoader2 @57b866df; hudson.model.Project is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @69b2283a)
java.lang.ClassCastException: class hudson.matrix.MatrixProject cannot be cast to class hudson.model.Project (hudson.matrix.MatrixProject is in unnamed module of loader jenkins.util.URLClassLoader2 @57b866df; hudson.model.Project is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @69b2283a)
    at hudson.plugins.build_timeout.global.GlobalTimeOutConfiguration.timeOutFor(GlobalTimeOutConfiguration.java:97)
    at hudson.plugins.build_timeout.global.GlobalTimeOutRunListener.setUpEnvironment(GlobalTimeOutRunListener.java:41)
    at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:617)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)
    at hudson.model.Run.execute(Run.java:1900)
    at hudson.matrix.MatrixBuild.run(MatrixBuild.java:323)
    at hudson.model.ResourceController.execute(ResourceController.java:101)
    at hudson.model.Executor.run(Executor.java:442)
krisstern commented 1 year ago

Yeah @Pesa Our tests didn't catch this. Let me fix this now. Thanks for getting back to me.

krisstern commented 1 year ago

Just fixed the broken matrix build.

Pesa commented 1 year ago

Thanks, 1.28 works.

krisstern commented 1 year ago

You are welcome @Pesa! Glad it works now.