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

Merge March 8 security tests into their main class #7700

Merged
merged 6 commits into from
Mar 10, 2023

Conversation

Kevin-CB
Copy link
Contributor

@Kevin-CB Kevin-CB commented Mar 9, 2023

This PR aims 2 goals:

Testing done

Modified tests successfully run on Java 11 and Java 17 on Ubuntu 22.04, RHEL 8.7, and Debian testing

Proposed changelog entries

N/A

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

@daniel-beck

Maintainer checklist

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

  • 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).

@Kevin-CB Kevin-CB changed the title Cleanup security tests from Merge the March 8 security fix tests into their main class Mar 9, 2023
@Kevin-CB Kevin-CB changed the title Merge the March 8 security fix tests into their main class Merge March 8 security fix tests into their main class Mar 9, 2023
@Kevin-CB Kevin-CB changed the title Merge March 8 security fix tests into their main class Merge March 8 security tests into their main class Mar 9, 2023
@timja timja added the skip-changelog Should not be shown in the changelog label Mar 9, 2023

@Test
@Issue("SECURITY-2823")
public void verifyUploadedPluginPermission() throws Exception {
Copy link
Member

@timja timja Mar 9, 2023

Choose a reason for hiding this comment

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

can we ignore this test until it is stabilised please?

I can reproduce it 100% with:

mvn test -Dtest=hudson.PluginManagerTest#verifyUploadedPluginPermission

(on macOS)

No matter how long you wait the file is not there, possibly it gets deleted too quickly or its going somewhere else?

It passes in IntelliJ though

(have tried a bit but haven't figured it out)

Copy link
Member

Choose a reason for hiding this comment

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

(although this test does pass for me on master weirdly although failing I think most of the time on CI)

Copy link
Contributor

@MarkEWaite MarkEWaite Mar 10, 2023

Choose a reason for hiding this comment

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

Tests pass for me locally with Java 11 on RHEL 8, Java 11 on Ubuntu 22.04, and Java 11 on Debian testing with the command:

git clean -xffd; mvn clean -DforkCount=1C -Dtest=PluginManagerTest,DirectoryBrowserSupportTest,ComputerSetTest,ExecutorTest,SearchTest clean verify

PluginManagerTest fails for me with Java 17 on RHEL 8, Java 17 on Ubuntu 22.04, and Java 17 on Debian testing with the same command.

The Java 17 failures reported:

PluginManagerTest.verifyUploadedPluginPermission:757 » ConditionTimeout Condition with hudson.PluginManagerTest was not fulfilled within 10 seconds.

@Kevin-CB
Copy link
Contributor Author

Apparently on Java 17, File.createTempFile() ignore the Java system property java.io.tmpdir while FileS.createTempFile() don't ignore it. Resulting in our hpi file created in a different folder than the one we're checking.

Copy link
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.

PluginManagerTest is now passing with Java 17 on RHEL 8, Java 17 on Ubuntu 22.04, and Java 17 on Debian testing. Thanks very much!

@MarkEWaite
Copy link
Contributor

I recommend that we skip the 24 hour merge window for this and instead merge it as soon as CI passes.

@NotMyFault
Copy link
Member

NotMyFault commented Mar 10, 2023 via email

@MarkEWaite MarkEWaite added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Mar 10, 2023
@timja timja merged commit 9d97938 into jenkinsci:master Mar 10, 2023
krisstern pushed a commit to krisstern/jenkins that referenced this pull request Mar 20, 2023
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
Projects
None yet
6 participants