-
-
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
[JENKINS-69650] Fix test reporting of Security2779Test #7134
Conversation
Apache Maven surefire plugin does not seem to fully support parameterized JUnit 4 tests. See junit-team/junit5#990 for discussion of the issue. The surefire plugin acts as though the Security2779Test is being run multiple times with the same argument and treats a failure of one argument as a "flaky test". In this case, the test is not flaky as far as I can tell, it is showing a real failure when the argument is "#icon-panel svg". The test passes consistently when the argument is "#link-panel a". The consistent failures that I've seen were on Red Hat Enterprise Linux 8.6 with Eclipse Temurin Java 11.0.16.1. The same failure was seen in the Jenkins 2.369 weekly build. This commit does not fix the failure, it just makes it easier to see that there is a failure.
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.
@Parameterized
is often a mess. Simpler & clearer (IMO) to get rid of it and just have one test method run assertions on both selectors. Or define two @Test
methods which simply delegate to a private
implementation.
Make the test failure explicit and visible in the build log
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.
Thanks!
While 84f41d2 in 2.370 addresses the failure, this change is still worthwhile. |
This sounds like SUREFIRE-2087 though that is reported for JUnit 5. I wonder if the same applies to JUnit 4? Or we caused a 5-specific bug to start affecting our codebase by introducing the 5 libraries with the vintage engine? It would be nice if someone could reproduce this in a self-contained test case using 4 (with or without 5 in the classpath) and comment accordingly in SUREFIRE-2087. |
@daniel-beck and @NotMyFault are there additional changes needed for this pull request before it is approved and starts the 24 hour countdown timer to merge? |
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.
Looks good, no review or merge blocker from my side.
Thanks for taking care of it :)
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
JENKINS-69650 Fix test reporting of Security2779Test
Apache Maven surefire plugin does not seem to fully support parameterized JUnit 4 tests. See junit-team/junit5#990 for discussion of the issue.
The surefire plugin acts as though the Security2779Test is being run multiple times with the same argument and treats a failure of one argument as a "flaky test". In this case, the test is not flaky as far as I can tell, it is showing a real failure when the argument is "#icon-panel svg".
The test passes consistently when the argument is "#link-panel a".
The consistent failures that I've seen were on Red Hat Enterprise Linux 8.6 with Eclipse Temurin Java 11.0.16.1. The same failure was seen in the Jenkins 2.369 weekly build.
This commit does not fix the failure, it just makes it easier to see that there is a failure.
It appears that the parameterized test started failing for the '#icon-panel svg' with commit 3923e45 in pull request #7052. See the bisection command used in JENKINS-69650
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgrade@Restricted
or have@since TODO
Javadoc, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
if applicable.eval
to ease future introduction of Content-Security-Policy directives (see documentation on jenkins.io).Desired reviewers
@NotMyFault, @daniel-beck
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are accurate, human-readable, and in the imperative moodIf the change needs additional upgrade steps from users,upgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (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 aslts-candidate
to be considered (see query).