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
[JENKINS-31516] Run re-index on children on organization re-index #20
Conversation
…-index is done for child items
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
🐝 |
1 similar comment
🐝 |
A test would be nice but 🐝 |
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
👍 to add a new test |
Well, if you have time to write a test (verifying that it fails in the expected way with your fix commented out), that would be great, otherwise you are free to merge as is. |
🐝 |
public static class BranchProjectFactoryImpl extends BranchProjectFactory<FreeStyleProject, FreeStyleBuild> { | ||
|
||
@Override | ||
public FreeStyleProject newInstance(Branch branch) { | ||
FreeStyleProject job = new FreeStyleProject(getOwner(), branch.getName()); | ||
job.onCreatedFromScratch(); |
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.
I don't like this, but if I remove it then I get:
Dec 04, 2015 12:31:02 PM hudson.model.Executor finish1
SEVERE: Executor threw an exception
java.lang.AssertionError
at jenkins.model.lazy.LazyBuildMixIn.createBuildRunMap(LazyBuildMixIn.java:139)
at jenkins.model.lazy.LazyBuildMixIn.onCreatedFromScratch(LazyBuildMixIn.java:96)
at hudson.model.AbstractProject.onCreatedFromScratch(AbstractProject.java:310)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$1.created(ComputedFolder.java:171)
at jenkins.branch.MultiBranchProject$1.observe(MultiBranchProject.java:351)
at jenkins.scm.impl.SingleSCMSource.retrieve(SingleSCMSource.java:99)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:143)
at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:295)
at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:106)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Any idea?
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.
Not sure, something you need to debug. The Javadoc for newInstance
explicit forbids you from calling onCreatedFromScratch
, since this is called by MultiBranchProject
.
synchronized (rootDir) { | ||
int limit = 0; | ||
while (limit < 5) { | ||
rootDir.wait(1000); |
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.
Huh?? Who is notify
ing a File
?
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.
Nobody, it just waits for 1 second (5 in total) for the message to appear, then returns or assert unconditionally.
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.
🐜 So why not use Thread.sleep
?
🐛 for the stray call to |
Caught! 😄 |
@@ -65,7 +75,23 @@ public void configRoundTrip() throws Exception { | |||
assertEquals(MockFactory.class, projectFactories.get(0).getClass()); | |||
assertEquals(MockFactory.class, projectFactories.get(1).getClass()); | |||
} | |||
@TestExtension("configRoundTrip") | |||
|
|||
@Test |
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.
🐜 missing @Issue
🐝 |
@reviewbybees done |
[JENKINS-31516] Run re-index on children on organization re-index
JENKINS-31516
@reviewbybees