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

Retry flaky unified tests #1565

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

katcharov
Copy link
Contributor

@katcharov katcharov commented Nov 20, 2024

JAVA-5393 (part of).

See WRITING-28651

This creates N copies (attempts) of the unified tests, and places a try-catch around shouldPassAllOutcomes. If an attempt passes, ensuing attempts are ignored. Failures are ignored, except the last attempt.

This is not intended to fully resolve the issue, but is a low-cost fix that should reduce failing tests.

@katcharov katcharov requested review from a team and vbabanin and removed request for a team November 20, 2024 22:30
@katcharov katcharov force-pushed the JAVA-5393-unified-retries branch from 6282ce7 to 8e8d7a3 Compare November 21, 2024 18:17
@katcharov katcharov marked this pull request as draft November 21, 2024 18:17
@katcharov katcharov force-pushed the JAVA-5393-unified-retries branch from 8e8d7a3 to 6f3b56d Compare November 21, 2024 21:10
@katcharov katcharov force-pushed the JAVA-5393-unified-retries branch from d24e003 to 6b53427 Compare December 2, 2024 22:27
Comment on lines 330 to +331
public void shouldPassAllOutcomes(
final String testName,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method contains the try-catch with the new retry logic.

@katcharov katcharov force-pushed the JAVA-5393-unified-retries branch from 86681ad to 3b2c915 Compare December 5, 2024 23:48
Comment on lines +43 to +55

// TODO reasons for retry
// Exception in encryption library: ChangeCipherSpec message sequence violation
def.retry("TODO reason")
.whenFailureContains("ChangeCipherSpec message sequence violation")
.test("client-side-encryption", "namedKMS-createDataKey", "create datakey with named KMIP KMS provider");

def.retry("TODO reason")
.whenFailureContains("Number of checked out connections must match expected")
.test("load-balancers", "cursors are correctly pinned to connections for load-balanced clusters", "pinned connections are returned after a network error during a killCursors request");

def.retry("TODO reason")
.test("client-side-encryption", "namedKMS-rewrapManyDataKey", "rewrap to kmip:name1");
Copy link
Contributor Author

@katcharov katcharov Dec 5, 2024

Choose a reason for hiding this comment

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

These are flaky failures from evergreen. Reasons should be specified, or these 3 retries can be removed and added in a separate PR, after examining the failures.

}
if (!testDef.matchesThrowable(e)) {
// if the throwable is not matched, test definitions were not intended to apply; rethrow it
throw e;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested this by failing an assertion within the try of shouldPassAllOutcomes. When the assertion message matches what is specified in a def, it will ignore, ignore, and then fail with that assertion failure. When it does not match, the first instance will fail, and the remaining will be ignored.

@katcharov katcharov force-pushed the JAVA-5393-unified-retries branch from ce1918c to 784dc51 Compare December 6, 2024 00:24
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.

1 participant