Skip to content

Commit f62539e

Browse files
committed
Add docs
1 parent 6402460 commit f62539e

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public void shouldPassAllOutcomes(
389389
if (isLastAttempt) {
390390
throw e;
391391
}
392-
392+
393393
ignoreRemaining.remove(testName);
394394
abort("Ignoring failure and retrying attempt " + attemptNumber);
395395
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ public TestApplicator when(final Supplier<Boolean> precondition) {
489489
return this;
490490
}
491491

492+
/**
493+
* The modification, if it is a RETRY, will only be applied when the
494+
* failure message contains the provided message fragment. If an
495+
* {@code AssertionFailedError} occurs, and has a cause, the cause's
496+
* message will be checked. Otherwise, the throwable will be checked.
497+
*/
492498
public TestApplicator whenFailureContains(final String messageFragment) {
493499
this.matchesThrowable = (final Throwable e) -> {
494500
// inspect the cause for failed assertions with a cause
@@ -526,11 +532,15 @@ public enum Modifier {
526532
*/
527533
SKIP,
528534
/**
529-
* Retry the test on failure.
535+
* Ignore results and retry the test on failure. Will not repeat the
536+
* test if the test succeeds. Multiple copies of the test are used to
537+
* facilitate retries.
530538
*/
531539
RETRY,
532540
/**
533-
* Retry the test multiple times, without ignoring failures.
541+
* The test will be retried multiple times, without the results being
542+
* ignored. This is a helper that can be used, in patches, to check
543+
* if certain tests are (still) flaky.
534544
*/
535545
FORCE_FLAKY,
536546
}

0 commit comments

Comments
 (0)