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

Do not load detached plugins during tests #2829

Merged
merged 8 commits into from May 1, 2017

Conversation

jglick
Copy link
Member

@jglick jglick commented Apr 3, 2017

Downstream of jenkinsci/jenkins-test-harness#54.

Description

While running some core functional tests in an environment with extremely slow filesystem access (Windows over VirtualBox; some driver problem I suppose), I noticed that each test case seemed to spend several minutes during initialization in createClassJarFromWebInfClasses, especially in subversion.jpi, but also in several other smaller plugins.

Now classes.jar is generated at build time for any plugin built in the past four years or so, but to allow Remoting to cache JARs for really old plugin binaries, we do this step at runtime if necessary. I added a warning when that was necessary.

But why was every functional test loading subversion-1.54.jpi and the like, anyway? These are detached plugins as of Jenkins 2, not normally used except when needed during upgrades. It turns out the test harness, unlike the real plugin manager, was loading all detached plugins. This just seems like a waste of CPU & I/O.

Changelog entries

None required.

Desired reviewers

@reviewbybees, @jenkinsci/code-reviewers

Also warn about plugins which force us to create classes.jar.
@ghost
Copy link

ghost commented Apr 3, 2017

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.

…o.jenkins-ci.org so as to be able to test upstream component PRs.
@oleg-nenashev
Copy link
Member

Would be nice to understand how it will work together with #2754, which will likely require detached plugins at some point (e.g. moving the master-side Remoting protocol specifics to a remoting plugin). I would expect such (System?) detached plugins to be always loaded

@jglick
Copy link
Member Author

jglick commented Apr 5, 2017

#2754 […] will likely require detached plugins

Not that I know of. Anyway this PR is only about tests, not production mode.

@olivergondza
Copy link
Member

I am +1 on the idea. On a brief look 4/5 test failures are related, though.

@jglick jglick added the needs-comments-resolved Comments in the PR need to be addressed before it can be considered for merging label Apr 6, 2017
@jglick
Copy link
Member Author

jglick commented Apr 6, 2017

Indeed it looks like this needs some test fixes.

@jglick
Copy link
Member Author

jglick commented Apr 6, 2017

The unrelated failures are covered by INFRA-1141.

@jglick jglick added needs-more-reviews Complex change, which would benefit from more eyes and removed needs-comments-resolved Comments in the PR need to be addressed before it can be considered for merging labels Apr 6, 2017
@jglick
Copy link
Member Author

jglick commented Apr 25, 2017

Still have a test failure

org.junit.ComparisonFailure: expected:<...64)"},{"executors":1[,"os":"Linux (amd64)"]}]> but was:<...64)"},{"executors":1[]}]>
	at org.junit.Assert.assertEquals(Assert.java:115)
	at org.junit.Assert.assertEquals(Assert.java:144)
	at hudson.model.UsageStatisticsTest.compareWithFile(UsageStatisticsTest.java:175)
	at hudson.model.UsageStatisticsTest.roundtrip(UsageStatisticsTest.java:121)

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Kinda 🐜 for the upstream jenkinsci/jenkins-test-harness#54 , which breaks compatibility of JTH by removing TestPluginManager#installResourcePlugin . OTOH I do not see any usages of this method.

This PR looks good, but we need to agree what Binary compat requirements do we declare for JTH

@@ -952,6 +952,7 @@ public synchronized void resolveDependantPlugins() {
* with a reasonable up-to-date check. A convenience method to be used by the {@link #loadBundledPlugins()}.
*/
protected void copyBundledPlugin(URL src, String fileName) throws IOException {
LOGGER.log(FINE, "Copying {0}", src);
Copy link
Member

Choose a reason for hiding this comment

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

I still have not created a PR with logging improvements :(

@jglick
Copy link
Member Author

jglick commented Apr 25, 2017

breaks compatibility of JTH by removing TestPluginManager#installResourcePlugin

It was used only in the code I am deleting here.

we need to agree what Binary compat requirements do we declare for JTH

We make no guarantees about binary compatibility of test utilities.

@jglick
Copy link
Member Author

jglick commented Apr 25, 2017

The test failures are still INFRA-1141.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Not fully convinced about test utilities, but I agree it is not mentioned anywhere. Hence 🐝

@jglick jglick added ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback and removed needs-more-reviews Complex change, which would benefit from more eyes labels Apr 26, 2017
@jglick
Copy link
Member Author

jglick commented Apr 26, 2017

@reviewbybees done

@oleg-nenashev
Copy link
Member

Will merge it after the weekly release

@jglick
Copy link
Member Author

jglick commented Apr 30, 2017

Why after? There is no testing that will happen in the next week that did not happen in the previous week. Just wondering about the hesitation over merging a test-only PR.

@oleg-nenashev
Copy link
Member

Just because we already had issues with parallel PR collisions. I didn't want to merge it closely to the weekly. Merging now

@oleg-nenashev oleg-nenashev merged commit 0993b70 into jenkinsci:master May 1, 2017
@jglick jglick deleted the no-detached-plugins branch May 1, 2017 13:57
jglick added a commit to jglick/jenkins that referenced this pull request May 1, 2017
Picking up jenkinsci#2829 to see if that makes a difference in tests.
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
Projects
None yet
3 participants