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

[3.x] Add robustness to some of the timing-susceptible metrics tests; add util matcher with retry #5047

Merged

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Oct 3, 2022

Resolves #5029

(back port of #4984)

See overview in #5032

Signed-off-by: tim.quinn@oracle.com tim.quinn@oracle.com

…til matcher with retry

Signed-off-by: tim.quinn@oracle.com <tim.quinn@oracle.com>
@tjquinno tjquinno changed the title Add robustness to some of the timing-susceptible metrics tests; add util matcher with retry [3.x] Add robustness to some of the timing-susceptible metrics tests; add util matcher with retry Oct 3, 2022
@tjquinno tjquinno merged commit d0059b9 into helidon-io:helidon-3.x Oct 4, 2022
@tjquinno tjquinno deleted the intermittent-metrics-tests-3.x branch October 4, 2022 05:20
Comment on lines +74 to +82
public static void retry(Callable<Boolean> work) throws Exception {
for (int i = 0; i < RETRY_COUNT; i++) {
if (work.call()) {
return;
}
Thread.sleep(RETRY_DELAY_MS);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@tjquinno I don't think this actually retries anything since only usage always returns true and this thing doesn't catch exceptions. We do have really fancy fault tolerance Retry which works really well.

Copy link
Member Author

@tjquinno tjquinno Oct 5, 2022

Choose a reason for hiding this comment

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

You're right. I'd intended for the retry method to repeat if the work returned false (and you are correct, so far the only use returns true) or if the work threw an exception (such as the asserts in the lambda which is passed to retry in its only use).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3.x] Intermittent HelloWorldAsyncResponseTest.testAsyncWithArg
4 participants