Skip to content

Commit 784dc51

Browse files
committedDec 6, 2024·
Add docs
1 parent 3b2c915 commit 784dc51

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
 

‎driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ public void shouldPassAllOutcomes(
382382
if (isLastAttempt) {
383383
throw e;
384384
}
385-
385+
386386
ignoreRemaining.remove(testName);
387387
abort("Ignoring failure and retrying attempt " + attemptNumber);
388388
}

‎driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ public TestApplicator when(final Supplier<Boolean> precondition) {
509509
return this;
510510
}
511511

512+
/**
513+
* The modification, if it is a RETRY, will only be applied when the
514+
* failure message contains the provided message fragment. If an
515+
* {@code AssertionFailedError} occurs, and has a cause, the cause's
516+
* message will be checked. Otherwise, the throwable will be checked.
517+
*/
512518
public TestApplicator whenFailureContains(final String messageFragment) {
513519
this.matchesThrowable = (final Throwable e) -> {
514520
// inspect the cause for failed assertions with a cause
@@ -546,11 +552,15 @@ public enum Modifier {
546552
*/
547553
SKIP,
548554
/**
549-
* Retry the test on failure.
555+
* Ignore results and retry the test on failure. Will not repeat the
556+
* test if the test succeeds. Multiple copies of the test are used to
557+
* facilitate retries.
550558
*/
551559
RETRY,
552560
/**
553-
* Retry the test multiple times, without ignoring failures.
561+
* The test will be retried multiple times, without the results being
562+
* ignored. This is a helper that can be used, in patches, to check
563+
* if certain tests are (still) flaky.
554564
*/
555565
FORCE_FLAKY,
556566
}

0 commit comments

Comments
 (0)