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

Failure reporting #1337

Closed
wants to merge 28 commits into from
Closed

Failure reporting #1337

wants to merge 28 commits into from

Conversation

basil
Copy link
Member

@basil basil commented Jul 27, 2022

Checking to see how close we are to resolving #895.

@jetersen
Copy link
Member

jetersen commented Jul 27, 2022

interesting test failures 🤔

Complains about Jenkins.instance is missing inside jcasc methods 😓

Makes no sense? 🤔

https://github.com/jenkinsci/configuration-as-code-plugin/blob/302609121b14e859d853abb1c45b64367380cbd8/plugin/src/main/java/io/jenkins/plugins/casc/impl/configurators/DataBoundConfigurator.java#L217

[2022-07-27T17:20:22.910Z] ExecutionException There was an error in the forked process
[2022-07-27T17:20:22.910Z] Test mechanism :: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
[2022-07-27T17:20:22.910Z] org.apache.maven.surefire.api.testset.TestSetFailedException: Test mechanism :: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.common.junit4.JUnit4RunListener.rethrowAnyTestMechanismFailures(JUnit4RunListener.java:226)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:175)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
[2022-07-27T17:20:22.910Z] Caused by: java.lang.IllegalStateException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong.
[2022-07-27T17:20:22.910Z] 	at jenkins.model.Jenkins.get(Jenkins.java:812)
[2022-07-27T17:20:22.910Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.getDescriptor(DataBoundConfigurator.java:217)
[2022-07-27T17:20:22.910Z] 	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.getName(DataBoundConfigurator.java:205)
[2022-07-27T17:20:22.910Z] 	at io.jenkins.plugins.casc.ConfiguratorException.getMessage(ConfiguratorException.java:70)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.Throwable.getLocalizedMessage(Throwable.java:397)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.Throwable.toString(Throwable.java:496)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.String.valueOf(String.java:4218)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.Throwable.printEnclosedStackTrace(Throwable.java:710)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.Throwable.printStackTrace(Throwable.java:682)
[2022-07-27T17:20:22.910Z] 	at java.base/java.lang.Throwable.printStackTrace(Throwable.java:736)
[2022-07-27T17:20:22.910Z] 	at org.junit.internal.Throwables.getStacktrace(Throwables.java:63)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.Failure.getTrace(Failure.java:70)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.common.junit4.JUnit4StackTraceWriter.writeTraceToString(JUnit4StackTraceWriter.java:63)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder.toStackTrace(EventChannelEncoder.java:418)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder.access$000(EventChannelEncoder.java:76)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder$StackTrace.<init>(EventChannelEncoder.java:432)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder.encode(EventChannelEncoder.java:365)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder.encode(EventChannelEncoder.java:289)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.booter.spi.EventChannelEncoder.testError(EventChannelEncoder.java:165)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.api.booter.ForkingRunListener.testError(ForkingRunListener.java:89)
[2022-07-27T17:20:22.910Z] 	at org.apache.maven.surefire.common.junit4.JUnit4RunListener.testFailure(JUnit4RunListener.java:155)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.SynchronizedRunListener.testFailure(SynchronizedRunListener.java:94)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.RunNotifier$6.notifyListener(RunNotifier.java:177)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.RunNotifier.fireTestFailures(RunNotifier.java:173)
[2022-07-27T17:20:22.910Z] 	at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:167)
[2022-07-27T17:20:22.911Z] 	at org.apache.maven.surefire.common.junit4.Notifier.fireTestFailure(Notifier.java:114)
[2022-07-27T17:20:22.911Z] 	at org.junit.internal.runners.model.EachTestNotifier.addFailure(EachTestNotifier.java:23)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:370)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
[2022-07-27T17:20:22.911Z] 	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
[2022-07-27T17:20:22.911Z] 	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:377)
[2022-07-27T17:20:22.911Z] 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:284)
[2022-07-27T17:20:22.911Z] 	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:248)
[2022-07-27T17:20:22.911Z] 	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:167)
[2022-07-27T17:20:22.911Z] 	... 4 more

@basil
Copy link
Member Author

basil commented Jul 27, 2022

Ah the one in Git plugin? Yeah, very weird. Only appears when Subversion plugin is on the test classpath, can be reproduced in git-plugin with

@@ -248,6 +248,11 @@
       <artifactId>jenkins-test-harness</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.jenkins-ci.plugins</groupId>
+      <artifactId>subversion</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <repositories>

and -Dtest=jenkins.plugins.git.BrowsersJCasCCompatibilityTest#roundTripTest but strangely enough it seems to be an error with plugin POM 4.43.1 but only a warning with plugin POM 4.44. 🤣

@basil
Copy link
Member Author

basil commented Jul 27, 2022

Seems that with org.apache.maven.surefire.junit4.JUnit4Provider it's a hard error but with org.apache.maven.surefire.junitplatform.JUnitPlatformProvider it's only a warning. :-) Still weird that the Subversion plugin triggers it somehow.

@jetersen
Copy link
Member

interesting see joda-time upperbound warnings.

We really ought to have it removed... Use java 8 time libraries 😅

pct.sh Outdated
@@ -40,7 +40,8 @@ MAVEN_PROPERTIES+=":jenkins.version=${JENKINS_VERSION}:overrideWar=$(pwd)/megawa
# TODO When all plugins in the managed set are using a plugin parent POM with HPI Plugin 3.29 or
# later (i.e., plugin parent POM 4.44 or later), this can be deleted.
#
MAVEN_PROPERTIES+=:hpi-plugin.version=3.30
# TODO https://github.com/jenkinsci/maven-hpi-plugin/pull/368
MAVEN_PROPERTIES+=:hpi-plugin.version=3.31-rc1289.8ccff91f4e1a
Copy link
Member

Choose a reason for hiding this comment

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

huh pretty useful being able to force HPI higher, not sure this is even a hack at this point. Especially when we need to fix a potential bug.

basil and others added 5 commits July 28, 2022 13:33
Bumps [theme-manager](https://github.com/jenkinsci/theme-manager-plugin) from 1.4 to 1.5.
- [Release notes](https://github.com/jenkinsci/theme-manager-plugin/releases)
- [Commits](jenkinsci/theme-manager-plugin@theme-manager-1.4...theme-manager-1.5)

---
updated-dependencies:
- dependency-name: io.jenkins.plugins:theme-manager
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@basil
Copy link
Member Author

basil commented Jul 28, 2022

OK, I figured out the compatibility problem between Git and Subversion:

WARNING i.j.p.c.i.c.HeteroDescribableConfigurator#handleDuplicateSymbols: Found multiple implementations for symbol = phabricator: [hudson.scm.browsers.Phabricator$PhabricatorDescriptor@62a6352a, hudson.plugins.git.browser.Phabricator$PhabricatorDescriptor@5522fa08]. Please report to plugin maintainer.

I was able to chase away the problem with this patch to Subversion:

diff --git a/src/main/java/hudson/scm/browsers/Phabricator.java b/src/main/java/hudson/scm/browsers/Phabricator.java
index 8ef1064..59fb4cb 100644
--- a/src/main/java/hudson/scm/browsers/Phabricator.java
+++ b/src/main/java/hudson/scm/browsers/Phabricator.java
@@ -8,6 +8,7 @@ import hudson.scm.SubversionRepositoryBrowser;
 import hudson.scm.EditType;
 import hudson.scm.RepositoryBrowser;
 import org.kohsuke.stapler.DataBoundConstructor;
+import org.jenkinsci.Symbol;
 
 import java.io.IOException;
 import java.net.URL;
@@ -101,6 +102,7 @@ public class Phabricator extends SubversionRepositoryBrowser {
     }
 
     @Extension
+    @Symbol("svnPhabricator")
     public static class PhabricatorDescriptor extends Descriptor<RepositoryBrowser<?>> {
         public String getDisplayName() {
             return "Phabricator";

@basil
Copy link
Member Author

basil commented Jul 29, 2022

Git/Subversion issue fixed in jenkinsci/subversion-plugin#273, hacked in 503c1e6

basil and others added 4 commits July 28, 2022 23:30
Bumps `subversion-plugin.version` from 2.15.5 to 2.16.0.

Updates `subversion` from 2.15.5 to 2.16.0
- [Release notes](https://github.com/jenkinsci/subversion-plugin/releases)
- [Changelog](https://github.com/jenkinsci/subversion-plugin/blob/master/docs/old-changelog.md)
- [Commits](jenkinsci/subversion-plugin@subversion-2.15.5...subversion-2.16.0)

Updates `subversion` from 2.15.5 to 2.16.0
- [Release notes](https://github.com/jenkinsci/subversion-plugin/releases)
- [Changelog](https://github.com/jenkinsci/subversion-plugin/blob/master/docs/old-changelog.md)
- [Commits](jenkinsci/subversion-plugin@subversion-2.15.5...subversion-2.16.0)

---
updated-dependencies:
- dependency-name: org.jenkins-ci.plugins:subversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jenkins-ci.plugins:subversion:tests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@basil basil closed this Jul 29, 2022
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