diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java index 7541d5d289..d9bffb2967 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java @@ -389,7 +389,7 @@ public void shouldPassAllOutcomes( if (isLastAttempt) { throw e; } - + ignoreRemaining.remove(testName); abort("Ignoring failure and retrying attempt " + attemptNumber); } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java index 0e895f4c80..e48c96972e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java @@ -489,6 +489,12 @@ public TestApplicator when(final Supplier precondition) { return this; } + /** + * The modification, if it is a RETRY, will only be applied when the + * failure message contains the provided message fragment. If an + * {@code AssertionFailedError} occurs, and has a cause, the cause's + * message will be checked. Otherwise, the throwable will be checked. + */ public TestApplicator whenFailureContains(final String messageFragment) { this.matchesThrowable = (final Throwable e) -> { // inspect the cause for failed assertions with a cause @@ -526,11 +532,15 @@ public enum Modifier { */ SKIP, /** - * Retry the test on failure. + * Ignore results and retry the test on failure. Will not repeat the + * test if the test succeeds. Multiple copies of the test are used to + * facilitate retries. */ RETRY, /** - * Retry the test multiple times, without ignoring failures. + * The test will be retried multiple times, without the results being + * ignored. This is a helper that can be used, in patches, to check + * if certain tests are (still) flaky. */ FORCE_FLAKY, }