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

Use JUnit Jupiter's global timeout settings #2425

Merged
merged 4 commits into from
Jan 30, 2020

Conversation

trustin
Copy link
Member

@trustin trustin commented Jan 30, 2020

Motivation:

JUnit Jupiter provides various properties that controls the timeout
behavior globally, and we could use them instead of manually specifying
Timeout annotations with magic numbers.

Modifications:

  • Disable timeout on debug by default.
  • Set 60-second timeout for all testables and life cycle methods.
  • Remove TestUtil.withTimeout()
  • Update JUnit from 5.5.2 and 4.12 to 5.6.0 and 4.13

Result:

No need to add Timeout annotation

Motivation:

JUnit Jupiter provides various properties that controls the timeout
behavior globally, and we could use them instead of manually specifying
`Timeout` annotations with magic numbers.

Modifications:

- Disable timeout on debug by default.
- Set 60-second timeout for all testables and life cycle methods.
- Remove `TestUtil.withTimeout()`

Result:

No need to add `Timeout` annotation
@trustin trustin added this to the 0.98.0 milestone Jan 30, 2020
@codecov
Copy link

codecov bot commented Jan 30, 2020

Codecov Report

Merging #2425 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2425      +/-   ##
============================================
+ Coverage     72.99%   73.04%   +0.04%     
+ Complexity    10753    10752       -1     
============================================
  Files           946      946              
  Lines         41804    41794      -10     
  Branches       5206     5206              
============================================
+ Hits          30515    30528      +13     
+ Misses         8627     8604      -23     
  Partials       2662     2662
Impacted Files Coverage Δ Complexity Δ
...om/linecorp/armeria/testing/internal/TestUtil.java 100% <ø> (+41.66%) 2 <0> (-3) ⬇️
...rp/armeria/internal/ConnectionLimitingHandler.java 78.37% <0%> (-13.52%) 10% <0%> (-1%)
.../armeria/client/endpoint/dns/DnsEndpointGroup.java 78.68% <0%> (-4.92%) 12% <0%> (-3%)
.../linecorp/armeria/internal/Http2GoAwayHandler.java 57.5% <0%> (-2.5%) 14% <0%> (-1%)
...a/com/linecorp/armeria/client/HttpChannelPool.java 76.22% <0%> (-2.46%) 57% <0%> (-2%)
...java/com/linecorp/armeria/server/DefaultRoute.java 96.07% <0%> (+0.65%) 74% <0%> (+1%) ⬆️
.../linecorp/armeria/client/Http2ResponseDecoder.java 63.86% <0%> (+0.84%) 34% <0%> (ø) ⬇️
...inecorp/armeria/server/HttpResponseSubscriber.java 85.53% <0%> (+1.27%) 71% <0%> (+2%) ⬆️
...m/linecorp/armeria/common/DefaultAttributeMap.java 79.5% <0%> (+1.5%) 34% <0%> (+1%) ⬆️
.../com/linecorp/armeria/server/RoutingPredicate.java 70.96% <0%> (+1.61%) 21% <0%> (+1%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b32b8e...3c49628. Read the comment docs.

Copy link
Collaborator

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Wow Jupiter is making fast, good progress

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Nice :-)

@trustin
Copy link
Member Author

trustin commented Jan 30, 2020

Special thanks to @KarboniteKream for inspiration.

Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

👍

@trustin trustin merged commit ad0350c into line:master Jan 30, 2020
@trustin trustin deleted the junit_default_timeouts branch January 30, 2020 08:37
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Motivation:

JUnit Jupiter provides various properties that controls the timeout
behavior globally, and we could use them instead of manually specifying
`Timeout` annotations with magic numbers.

Modifications:

- Disable timeout on debug by default.
- Set 60-second timeout for all testables and life cycle methods.
- Remove `TestUtil.withTimeout()`
- Update JUnit from 5.5.2 and 4.12 to 5.6.0 and 4.13

Result:

No need to add `Timeout` annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants