-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
More helpful error message for ExtensionList.lookupSingleton
#8646
Merged
NotMyFault
merged 1 commit into
jenkinsci:master
from
jglick:ExtensionList.lookupSingleton
Oct 30, 2023
Merged
More helpful error message for ExtensionList.lookupSingleton
#8646
NotMyFault
merged 1 commit into
jenkinsci:master
from
jglick:ExtensionList.lookupSingleton
Oct 30, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vlatombe
approved these changes
Oct 26, 2023
julieheard
approved these changes
Oct 26, 2023
Found a way to test, sort of. After mvnd -am -pl war -Pquick-build install
cd ../branch-api-plugin and diff --git src/main/java/jenkins/branch/WorkspaceLocatorImpl.java src/main/java/jenkins/branch/WorkspaceLocatorImpl.java
index 4515492..14d452b 100644
--- src/main/java/jenkins/branch/WorkspaceLocatorImpl.java
+++ src/main/java/jenkins/branch/WorkspaceLocatorImpl.java
@@ -82,7 +82,6 @@ import org.kohsuke.accmod.restrictions.NoExternalUse;
* @see "JENKINS-2111"
*/
@Restricted(NoExternalUse.class)
-@Extension(ordinal = -100)
public class WorkspaceLocatorImpl extends WorkspaceLocator {
private static final Logger LOGGER = Logger.getLogger(WorkspaceLocatorImpl.class.getName()); Before: $ mvn test -Dtest=WorkspaceLocatorImplTest\#locate
…
4.380 [id=39] INFO jenkins.InitReactorRunner$1#onAttained: Completed initialization
4.413 [id=20] WARNING jenkins.model.Jenkins#<init>: Exception in onOnline() for the computer listener class jenkins.branch.WorkspaceLocatorImpl$Collector on the built-in node
java.lang.IllegalStateException: Expected 1 instance of jenkins.branch.WorkspaceLocatorImpl but got 0
at hudson.ExtensionList.lookupSingleton(ExtensionList.java:454)
at jenkins.branch.WorkspaceLocatorImpl.lockFor(WorkspaceLocatorImpl.java:310)
at jenkins.branch.WorkspaceLocatorImpl$Collector.onOnline(WorkspaceLocatorImpl.java:631)
at jenkins.model.Jenkins.<init>(Jenkins.java:1026)
at hudson.model.Hudson.<init>(Hudson.java:86)
at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:697)
at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:406)
at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:601)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.lang.Thread.run(Thread.java:829)
…
ERROR] Failures:
[ERROR] WorkspaceLocatorImplTest.locate:157 expected:<…/branch-api-plugin/target/tmp/j h16047186359448965079/workspace/stuff_dev_flow> but was:<…/branch-api-plugin/target/tmp/j h16047186359448965079/workspace/stuff/dev%2Fflow>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
… After: $ mvn test -Dtest=WorkspaceLocatorImplTest\#locate -Djenkins.version=2.430-SNAPSHOT
…
java.lang.IllegalStateException: Found no instances of jenkins.branch.WorkspaceLocatorImpl registered (possible annotation processor issue); try using `mvn clean test -Dtest=…` rather than an IDE test runner
… |
NotMyFault
approved these changes
Oct 29, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/label ready-for-merge
This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!
flabrie
pushed a commit
to flabrie/jenkins
that referenced
this pull request
Oct 30, 2023
* master: (72 commits) [JENKINS-72189] fix drag&drop handle for existing repeatables (jenkinsci#8613) [JENKINS-72222] Fix inconsistent wording between login page and security configuration (jenkinsci#8633) More helpful error message for `ExtensionList.lookupSingleton` (jenkinsci#8646) Turkish localization fixes for build page (jenkinsci#8651) Update dependabot branch for LTS 2.426.x (jenkinsci#8659) Update dependency node to v20.9.0 (jenkinsci#8656) Update dependency sass to v1.69.5 (jenkinsci#8657) Bump org.jenkins-ci.main:jenkins-test-harness from 2096.vcfd8fa_a_67f86 to 2099.vc95b_86578f37 (jenkinsci#8653) Bump org.jenkins-ci.main:remoting from 3190.va_7870fc137d9 to 3192.v713e3b_039fb_e (jenkinsci#8654) Bump org.jenkins-ci.plugins:credentials from 1304.v5ec13eecef46 to 1307.v3757c78f17c3 (jenkinsci#8655) Bump commons-io:commons-io from 2.14.0 to 2.15.0 (jenkinsci#8647) Update Yarn to v4 (jenkinsci#8641) Bump org.jenkins-ci.plugins:credentials from 1293.vff276f713473 to 1304.v5ec13eecef46 (jenkinsci#8650) Bump org.jenkins-ci.main:remoting from 3186.vc3b_7249b_87eb_ to 3190.va_7870fc137d9 (jenkinsci#8649) Fix issues with help texts under security configuration (jenkinsci#8630) Turkish localization fixes for login and users management pages (jenkinsci#8631) Bump com.github.eirslett:frontend-maven-plugin from 1.14.0 to 1.14.2 (jenkinsci#8648) Bump org.jenkins-ci.main:remoting from 3181.v78543a_987053 to 3186.vc3b_7249b_87eb_ (jenkinsci#8643) Bump org.jenkins-ci.main:jenkins-test-harness from 2090.v6d1706e434a_b_ to 2096.vcfd8fa_a_67f86 (jenkinsci#8642) [maven-release-plugin] prepare for next development iteration ... # Conflicts: # core/src/main/resources/lib/form/repeatable.jelly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ready-for-merge
The PR is ready to go, and it will be merged soon if there is no negative feedback
skip-changelog
Should not be shown in the changelog
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A periodic issue, most recently noticed going over something with @julieheard: if you run
JenkinsRule
tests using a special test runner from an IDE which does not autodiscover annotation processors, things will be badly broken, and a typical symptom is this otherwise fairly opaque error. If in doubt, use Maven to run tests (and invoke theclean
phase to be sure).Testing done
None, my IDE runs Maven (well,
mvnd
) to begin with! Edit: #8646 (comment)Proposed changelog entries
Before the changes are marked as
ready-for-merge
:Maintainer checklist