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

Issue #5069 - Fixing assumeConnectTimeout test condition #5070

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Jul 21, 2020

Signed-off-by: Joakim Erdfelt joakim.erdfelt@gmail.com

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@joakime joakime added the Test label Jul 21, 2020
@joakime joakime self-assigned this Jul 21, 2020
@joakime joakime added this to In progress in Jetty 9.4.31 via automation Jul 21, 2020
@joakime joakime requested a review from sbordet July 21, 2020 21:05
@@ -520,7 +521,7 @@ private void assumeConnectTimeout(String host, int port, int connectTimeout)
catch (Throwable x)
{
// Abort if any other exception happens.
fail(x);
throw new TestAbortedException("Not able to validate connect timeout conditions", x);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use Assumptions instead of throwing directly - it's not clear if you want the test to fail or what.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test will abort, not fail.

Using Assumptions makes the test either continue or abort, never fail.
Abort marks the test as ignored.

Using TestAbortedException preserves the stacktrace, which is then reported when a test is aborted. (this information is even present in your IDE)
Using Assumptions loses this stacktrace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Bleah!

Jetty 9.4.31 automation moved this from In progress to Review in progress Jul 21, 2020
Jetty 9.4.31 automation moved this from Review in progress to Reviewer approved Jul 21, 2020
@joakime joakime merged commit 1b5268b into jetty-9.4.x Jul 22, 2020
Jetty 9.4.31 automation moved this from Reviewer approved to Done Jul 22, 2020
@joakime joakime deleted the jetty-9.4.x-5069-assumeconnecttimeout branch July 22, 2020 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Jetty 9.4.31
  
Done
Development

Successfully merging this pull request may close these issues.

HttpClientTimeoutTests can occasionally fail due to unreachable network
2 participants