-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Support junit 5; Migrate non-forked junit 3 test cases #593
Conversation
Migrate existing junit 3 tests to junit 5 with standard ParameterizedTest facility This uses @MethodSource providing the various ChannelRunner instances used for testing. Migrated existing assert/assume calls impacted tests to the new jupiter api. Overall this covers more combinations than the previous framework as some of them were actually not covered previously for some reason. Keeping existing junit 3 test cases from forked packages as the proper approach here would rather be to pull new versions.
~50% flake locally if I recall properly. |
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.
OK I think. JUnit 5 is pretty opaque to me.
Does this patch make Surefire timeouts apply automatically?
|
||
final ExecutionException e = assertThrows(ExecutionException.class, f::get); | ||
assertThat(e.getCause(), instanceOf(IOException.class)); | ||
final ExecutionException e = assertThrows(ExecutionException.class, () -> f.get(2, TimeUnit.SECONDS)); |
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.
Correcting flake I guess?
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.
Yes
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
Seems |
Do you plan to look into #593 (comment), or shall I just merge this as is? |
Added a timeout, I don't plan to investigate more time into the hanging test. |
ca83285 did not work it seems:
|
Maybe it worked so far as it went, but each test method gets run up to five times, and there are up to six parameter values, so spending a minute on each run in the worst case can be a lot. Hmm, but it seems that by default timeouts are not preëmptive—if you exceed the timeout (but the method completes), the test fails, but that is no good for ensuring CI completes in time. |
Some really weird stuff like remoting/src/test/java/org/jenkinsci/remoting/protocol/impl/ConnectionHeadersFilterLayerTest.java Lines 68 to 71 in ca83285
|
Migrate existing junit 3 tests to junit 5 with standard
ParameterizedTest
facilityThis uses
@MethodSource
providing the various ChannelRunner instances used for testing.Migrated existing assert/assume calls impacted tests to the new jupiter api.
Overall this covers more combinations than the previous framework as some of them were actually not covered previously for some reason, even though they were extending
RmiTestBase
.Keeping existing junit 3 test cases from forked packages as the proper approach here would rather be to pull new versions.