Skip to content

Speed up a few tests and re-enable JS on DirectoryBrowserSupportTest#10764

Closed
timja wants to merge 11 commits intojenkinsci:masterfrom
timja:htmlunit-wait-for-started-js
Closed

Speed up a few tests and re-enable JS on DirectoryBrowserSupportTest#10764
timja wants to merge 11 commits intojenkinsci:masterfrom
timja:htmlunit-wait-for-started-js

Conversation

@timja
Copy link
Copy Markdown
Member

@timja timja commented Jun 22, 2025

Plugin manager tests sped up by loading plugin without dependencies, a bunch of time was spent waiting for plugin installation / JS to execute in update center.

DirectoryBrowserSupportTest now runs fine with the new HtmlUnit API update in the test harness

See jenkinsci/jenkins-test-harness#985

Testing done

Proposed changelog entries

  • human-readable text

Proposed changelog category

/label skip-changelog

Proposed upgrade guidelines

N/A

Submitter checklist

  • The Jira issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@comment-ops-bot comment-ops-bot bot added the skip-changelog Should not be shown in the changelog label Jun 22, 2025
By using a plugin with no dependencies there's no background jobs required to wait for (that are hard to tell when complete)
Comment thread test/pom.xml Outdated
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Jul 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Please take a moment and address the merge conflicts of your pull request. Thanks!

Comment thread test/src/test/java/hudson/PluginManagerTest.java Outdated
Co-authored-by: Thorsten Scherler <scherler@gmail.com>
@timja timja marked this pull request as ready for review August 21, 2025 15:01
@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Aug 21, 2025
@timja
Copy link
Copy Markdown
Member Author

timja commented Aug 21, 2025

This PR improves test time on my machine:

master:

02:46

Just test harness change:

44.669s

Test change to require less dependency loading:

39.233


Non scientific testing, haven't run multiple builds and averaged.


I tried a couple of weeks ago to run many builds and see improvements but was too hard with tests falling over everywhere for other reasons.

A couple of sample builds:

Comment thread test/pom.xml Outdated
@timja timja changed the title Test JTH - Only wait for JS already running Speed up a few tests and re-enable JS on DirectoryBrowserSupportTest Aug 22, 2025
@timja timja requested review from a team and scherler August 22, 2025 12:30
Copy link
Copy Markdown
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@timja timja closed this Aug 23, 2025
@timja timja deleted the htmlunit-wait-for-started-js branch August 23, 2025 06:45
@jglick
Copy link
Copy Markdown
Member

jglick commented Aug 23, 2025

Is there a reason you closed this @timja?

@timja
Copy link
Copy Markdown
Member Author

timja commented Sep 1, 2025

Didn't have the time to address, the more important change was the htmlunit change to not wait forever for JS that is constantly running. These make a bit of difference to an individual test but not huge..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Should not be shown in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants