Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7b27940
Version: bump 5.7.0-beta0
strogiyotec Jan 16, 2026
1094102
Version: bump 5.7.0-SNAPSHOT
strogiyotec Jan 16, 2026
024e420
JAVA-5950 - Update Transactions Convenient API with exponential back…
nhachicha Dec 3, 2025
8071de6
Simplifying test, clean up.
nhachicha Dec 9, 2025
0f6e118
Fixing test
nhachicha Dec 9, 2025
19f296f
Update driver-sync/src/main/com/mongodb/client/internal/ClientSession…
nhachicha Dec 9, 2025
455f352
retrigger checks
nhachicha Dec 9, 2025
85ec5ef
retrigger checks
nhachicha Dec 9, 2025
5f2157a
retrigger checks
nhachicha Dec 9, 2025
f94d9c7
retrigger checks
nhachicha Dec 9, 2025
8c322c6
test cleanup
nhachicha Dec 9, 2025
14f339d
retrigger checks
nhachicha Dec 9, 2025
f593950
Test cleanup
nhachicha Dec 9, 2025
d12e1f3
retrigger checks
nhachicha Dec 10, 2025
26da297
Update the implementation according to the spec
nhachicha Dec 10, 2025
a1d5bca
Added prose test
nhachicha Dec 10, 2025
e8857e0
Flaky test
nhachicha Dec 10, 2025
b8d7abf
Remove extra Test annotation
nhachicha Dec 11, 2025
c2a91bf
Throwing correct exception when CSOT is used
nhachicha Dec 14, 2025
8957883
Simplifying implementation by relying on CSOT to throw when timeout i…
nhachicha Dec 14, 2025
e008a43
Fixing implementation according to spec changes in JAVA-6046 and http…
nhachicha Jan 13, 2026
a54d95a
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 13, 2026
553d6ba
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
c0136e1
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
09a1291
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
520fead
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
478e242
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
365f054
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Jan 14, 2026
098b4b4
Update driver-core/src/main/com/mongodb/internal/ExponentialBackoff.java
nhachicha Jan 14, 2026
4df0f94
PR feedback
nhachicha Jan 15, 2026
9f34468
remove annotation
nhachicha Jan 16, 2026
88071e0
Fix/improve ClientSessionImpl, remove ClientSessionClock
stIncMale Jan 26, 2026
e59c4cb
PR feedback
nhachicha Jan 29, 2026
9a925e1
Reduce flakiness in CSOT tests using withTransaction, by forcing an i…
nhachicha Jan 29, 2026
4bbef70
Using correct jitter value in CSOT tests using withTransaction
nhachicha Jan 29, 2026
1c97dc7
Guarding setting a custom jitter for only sync tests
nhachicha Jan 29, 2026
e32f90d
PR feedback
nhachicha Feb 2, 2026
0b3ee81
PR feedback
nhachicha Feb 2, 2026
fda498c
Fixing unit test
nhachicha Feb 2, 2026
e5ae458
- PR feedback
nhachicha Feb 12, 2026
24d4ee5
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Feb 12, 2026
4756404
Update driver-sync/src/test/functional/com/mongodb/client/WithTransac…
nhachicha Feb 12, 2026
f22198e
moved logic of ExponentialBackoff cleanup to correct class
nhachicha Feb 12, 2026
9dcd5c0
Fixing tests
nhachicha Feb 25, 2026
9676ff0
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Mar 24, 2026
9153831
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Mar 24, 2026
9eebf51
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Mar 24, 2026
0c10988
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Mar 24, 2026
8b24709
Update driver-core/src/main/com/mongodb/internal/TimeoutContext.java
nhachicha Mar 25, 2026
60acf51
Refactor `withTransaction`
stIncMale Mar 12, 2026
94a79db
Use `OperationHelper.unwrap` to get to the exception that carries labels
stIncMale Mar 26, 2026
d4bc4c7
Copy error labels from cause to wrapping timeout exception per DRIVER…
nhachicha Mar 26, 2026
11786dd
Fixing Javadoc
nhachicha Mar 26, 2026
43dab53
fix import indentation
nhachicha Mar 26, 2026
69630b0
Update driver-core/src/test/unit/com/mongodb/internal/time/Exponentia…
nhachicha Mar 31, 2026
ae3f140
Restore changes lost after rebase
nhachicha Mar 31, 2026
2f381d6
Update driver-sync/src/main/com/mongodb/client/internal/ClientSession…
nhachicha Apr 1, 2026
4a3d1ae
Clarifying misleading assertion message (Copilot feedback).
nhachicha Apr 1, 2026
00cd332
Implement changes from DRIVERS-3436
nhachicha Apr 2, 2026
dbc7511
Align with DRIVERS-3436.
nhachicha Apr 3, 2026
b067862
Merge remote-tracking branch 'origin/backpressure' into nh/backpressu…
nhachicha Apr 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

package com.mongodb.benchmark.benchmarks;

import org.bson.BsonArray;import org.bson.BsonDocument;
import org.bson.BsonArray;
import org.bson.BsonDocument;
import org.bson.RawBsonDocument;
import org.bson.codecs.BsonDocumentCodec;

Expand Down Expand Up @@ -52,4 +53,4 @@ public void setUp() throws IOException {
public int getBytesPerRun() {
return documentBytes.length * NUM_INTERNAL_ITERATIONS;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ public TimeoutContext(final TimeoutSettings timeoutSettings) {
this(false, timeoutSettings, startTimeout(timeoutSettings.getTimeoutMS()));
}

private TimeoutContext(final TimeoutSettings timeoutSettings, @Nullable final Timeout timeout) {
this(false, timeoutSettings, timeout);
}

private TimeoutContext(final boolean isMaintenanceContext,
final TimeoutSettings timeoutSettings,
@Nullable final Timeout timeout) {
Expand Down Expand Up @@ -176,6 +172,7 @@ public Timeout timeoutIncludingRoundTrip() {
* @param alternativeTimeoutMS the alternative timeout.
* @return timeout to use.
*/
@VisibleForTesting(otherwise = PRIVATE)
public long timeoutOrAlternative(final long alternativeTimeoutMS) {
if (timeout == null) {
return alternativeTimeoutMS;
Expand Down Expand Up @@ -380,11 +377,6 @@ public TimeoutContext withAdditionalReadTimeout(final int additionalReadTimeout)
return new TimeoutContext(timeoutSettings.withReadTimeoutMS(newReadTimeout > 0 ? newReadTimeout : Long.MAX_VALUE));
}

// Creates a copy of the timeout context that can be reset without resetting the original.
public TimeoutContext copyTimeoutContext() {
return new TimeoutContext(getTimeoutSettings(), getTimeout());
}

@Override
public String toString() {
return "TimeoutContext{"
Expand Down
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please have a look at the following review from Claude, and address relevant items. Start at the bottom with the action item summary. (Report is AI generated, as with copilot.)

https://github.com/mongodb/mongo-java-driver/blob/ad34228e32af311e31a52e04fff7b3d21626935f/review.md

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you please:

  1. run an AI tool to verify that the issues in that review.md, and report the output here? (That is, whether the issues are considered fixed now, and for those not fixed, why the tool is incorrect.)
  2. run Claude to review a) the code diff independently of this PR, and then b) after examining the content of this PR (the comments). I used Opus with high effort. Please also update the PR description with the results (for example, " found 15 issues as of commit abcd, and marked 5 of them as new after reviewing PR comments. I addressed, ran again, it found 8, with 4 already in the PR and the rest invalid").
  3. trigger copilot until it produces no valid issues, and update the description similarly (including regarding past copilot runs).

Copy link
Copy Markdown
Collaborator Author

@nhachicha nhachicha Apr 1, 2026

Choose a reason for hiding this comment

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

  1. run an AI tool to verify that the issues in that review.md, and report the output here? (That is, whether the issues are considered fixed now, and for those not fixed, why the tool is incorrect.)
Output using Claude Opus 4.6 review

Verification Results — review.md Issues vs Current Codebase

Fixed (15 issues)

Issue Description Details
2.3 Jitter Javadoc [0,1)[0,1] Javadoc now correctly says [0, 1]
3.2 Javadoc "0-based" → "1-based" Now says attempt number > 0 with clear assertion message
3.3 Format string % d spacing Fixed, now uses "%d ms"
3.4 Redundant clearTransactionContextOnError Resolved in refactored structure
3.5 applyMajorityWriteConcern before continue outer Fixed — now uses continue within commit-retry loop, no continue outer
4.5 timeoutException accepts Throwable Renamed to wrapInMongoTimeoutException, accepts MongoException
4.6 Variable named hasTimeoutMS Renamed to timeoutMsConfigured
4.7 Dead TimeoutContext(TimeoutSettings, Timeout) constructor Removed
4.8 timeoutOrAlternative(Timeout) unnecessary The original Timeout timeoutOrAlternative(Timeout) method was removed. The current long timeoutOrAlternative(long) is a different method with
different signature/purpose, used broadly across the codebase — not the target of the reviewer's comment
5.1 ExponentialBackoffTest is public Now package-private
5.2 Indentation misalignment Fixed
5.7 Trivial constant comment Removed
5.8 Test assertion patterns (-4 code, missing assertInstanceOf/assertSame) Fixed — modern assertion patterns used
5.11 Blank line inside if/else block Fixed
4.4 withTransaction structure doesn't follow spec Structure has been reworked

Partially Fixed (1 issue)

Issue Description Details
2.2 Error labels not copied to wrapping timeout exception Fixed at the call site: wrapInMongoTimeoutException at ClientSessionImpl.java:414 explicitly copies labels via
cause.getErrorLabels().forEach(timeoutException::addLabel). Not fixed at the constructor level: MongoException(String, Throwable) still does not copy labels, unlike `MongoException(int, String,
Throwable)which does. The reviewer's broader architectural concern about constructor inconsistency remains open, but thewithTransaction` path is correct.

Deferred (1 issue)

Issue Description Details
2.1 Spec submodule outdated (points to bb9dddd8, needs ≥ 1125200e) Intentionally deferred — tracked as TODO-BACKPRESSURE in [PR
#1918](#1918 (comment)). Submodule will be updated to ≥ 1125200e after merging this PR into backpressure. Not a blocker for this PR.

Summary

Status Count
Fixed 15
Partially fixed (call-site fix in place, constructor concern open) 1
Deferred to another PR 1
Total 17

2.run Claude to review a) the code diff independently of this PR, and then b) after examining the content of this PR (the comments). I used Opus with high effort. Please also update the PR description with the results (for example, " found 15 issues as of commit abcd, and marked 5 of them as new after reviewing PR comments. I addressed, ran again, it found 8, with 4 already in the PR and the rest invalid").

Claude Review code diff only then with content and comment ## Remaining Issues to Address
# Issue Source Severity File(s) Status Tracking
1 testJitterSupplier should be volatile — mutable static read/written across threads without memory visibility guarantee @stIncMale, Copilot, diff review Low (test-only)
ExponentialBackoff.java Open — deferred JAVA-6079
2 withTransaction code doesn't clearly follow the spec algorithm — hard to verify correctness against the specification's prose steps @stIncMale High ClientSessionImpl.java Open —
@stIncMale proposed restructure in fd951e9 not yet cherry-picked JAVA-6154
3 Spec "Note 1" about error propagation needs rework — the spec language around propagation/raising is inconsistent @stIncMale, @katcharov Medium Spec-side Open — spec change needed
DRIVERS-3436
4 applyMajorityWriteConcernToTransactionOptions called on outer (transaction) retry — should only be called on commit retry; may spoil write concern for next transaction attempt @stIncMale Medium
ClientSessionImpl.java (commit retry loop) Open — addressed in @stIncMale's fd951e9 but not cherry-picked Part of JAVA-6154
5 TODO-BACKPRESSURE comments in production code — must be resolved before merging backpressuremain diff review Low MongoException.java, ExponentialBackoff.java Open — blocked on
docs PR (10gen/docs-mongodb-internal#17281) Implicit
6 Spec submodule not pointing to latest spec tests — new transactions-convenient-api JSON tests not included @stIncMale Medium testing/resources/specifications (submodule) Open — main
updated (55e1861) but not merged into backpressure TODO-BACKPRESSURE to add in test runner
7 @stIncMale's proposed refactor commit (fd951e9) not integrated — contains fixes for items 2, 3, 4 plus removal of unnecessary timeoutOrAlternative, cleaner variable naming
(timeoutMsConfigured), and MongoTimeoutException no-double-wrap logic @stIncMale High ClientSessionImpl.java, TimeoutContext.java Open — agreed upon but changes not pushed
8 Verify spec test withTransaction surfaces a timeout after exhausting transient transaction retries is run @stIncMale (comment) Medium Test runner config Open — TODO-BACKPRESSURE Valentin
reminder left in PR comments
9 Verify prose tests assert all error labels are copied to wrapping exception @stIncMale (comment) Medium WithTransactionProseTest.java Partially addressed — labels are copied in code, but
@stIncMale hasn't confirmed test coverage is complete
10 OTel tracing terminology inconsistency (finalize vs finish vs stop) @stIncMale Low (unrelated to PR scope) ClientSessionImpl.java tracing code Open — acknowledged as orthogonal; no
ticket created yet

Priority Summary

  • Must resolve before merge to backpressure: Items 7 (integrate @stIncMale's refactor), 8, 9
  • Must resolve before merge to main: Items 5 (TODOs), 6 (submodule)
  • Tracked for future work: Items 1 (JAVA-6079), 2/3/4 (JAVA-6154, DRIVERS-3436), 10

3.trigger copilot until it produces no valid issues, and update the description similarly (including regarding past copilot runs).

Copilot happy after 5 rounds (mostly false positives or nit comments)
Round 1
Round 2
Round 3
Round 4
Round 5

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
* To enable unit testing of classes that rely on System.nanoTime
*
* <p>This class is not part of the public API and may be removed or changed at any time</p>
*
* @deprecated Use {@link com.mongodb.internal.time.SystemNanoTime} in production code,
* and {@code Mockito.mockStatic} in test code to tamper with it.
*/
@Deprecated
public final class Time {
static final long CONSTANT_TIME = 42;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.mongodb.internal.time;

import com.mongodb.internal.VisibleForTesting;

import java.util.concurrent.ThreadLocalRandom;
import java.util.function.DoubleSupplier;

import static com.mongodb.assertions.Assertions.assertTrue;
import static com.mongodb.internal.VisibleForTesting.AccessModifier.PRIVATE;

/**
* Provides exponential backoff calculations with jitter for retry scenarios.
*/
public final class ExponentialBackoff {

private static final double TRANSACTION_BASE_MS = 5.0;
@VisibleForTesting(otherwise = PRIVATE)
static final double TRANSACTION_MAX_MS = 500.0;
private static final double TRANSACTION_GROWTH = 1.5;

// TODO-JAVA-6079
private static DoubleSupplier testJitterSupplier = null;

private ExponentialBackoff() {
}

/**
* Calculate the backoff in milliseconds for transaction retries.
*
* @param attemptNumber attempt number > 0
* @return The calculated backoff in milliseconds.
*/
public static long calculateTransactionBackoffMs(final int attemptNumber) {
assertTrue(attemptNumber > 0, "Attempt number must be at least 1 (1-based) in the context of transaction backoff calculation");
double jitter = testJitterSupplier != null
? testJitterSupplier.getAsDouble()
: ThreadLocalRandom.current().nextDouble();
return Math.round(jitter * Math.min(
TRANSACTION_BASE_MS * Math.pow(TRANSACTION_GROWTH, attemptNumber - 1),
TRANSACTION_MAX_MS));
}

/**
* Set a custom jitter supplier for testing purposes.
*
* @param supplier A DoubleSupplier that returns values in [0, 1] range.
*/
@VisibleForTesting(otherwise = PRIVATE)
public static void setTestJitterSupplier(final DoubleSupplier supplier) {
testJitterSupplier = supplier;
}

/**
* Clear the test jitter supplier, reverting to default ThreadLocalRandom behavior.
*/
@VisibleForTesting(otherwise = PRIVATE)
public static void clearTestJitterSupplier() {
testJitterSupplier = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ public interface StartTime {
* @return a StartPoint, as of now
*/
static StartTime now() {
return TimePoint.at(System.nanoTime());
return TimePoint.at(SystemNanoTime.get());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mongodb.internal.time;

/**
* Avoid using this class directly and prefer using other program elements from {@link com.mongodb.internal.time}, if possible.
* <p>
* We do not use {@link System#nanoTime()} directly in the rest of the {@link com.mongodb.internal.time} package,
* and use {@link SystemNanoTime#get()} instead because we need to tamper with it via {@code Mockito.mockStatic},
* and mocking methods of {@link System} class is both impossible and unwise.
*/
public final class SystemNanoTime {
private SystemNanoTime() {
}

public static long get() {
return System.nanoTime();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ static TimePoint at(@Nullable final Long nanos) {

@VisibleForTesting(otherwise = PRIVATE)
long currentNanos() {
return System.nanoTime();
return SystemNanoTime.get();
}

/**
* Returns the current {@link TimePoint}.
*/
static TimePoint now() {
return at(System.nanoTime());
return at(SystemNanoTime.get());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.mongodb.internal.time;

import org.junit.jupiter.api.Test;

import java.util.function.DoubleSupplier;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

class ExponentialBackoffTest {
/**
* Expected {@linkplain ExponentialBackoff#calculateTransactionBackoffMs(int) backoffs} with 1.0 as
* {@link ExponentialBackoff#setTestJitterSupplier(DoubleSupplier) jitter}.
*/
private static final double[] EXPECTED_BACKOFFS_MAX_VALUES = {5.0, 7.5, 11.25, 16.875, 25.3125, 37.96875, 56.953125, 85.4296875, 128.14453125,
192.21679688, 288.32519531, 432.48779297, 500.0};

@Test
void testCalculateTransactionBackoffMs() {
for (int attemptNumber = 1; attemptNumber <= EXPECTED_BACKOFFS_MAX_VALUES.length; attemptNumber++) {
long backoff = ExponentialBackoff.calculateTransactionBackoffMs(attemptNumber);
long expectedBackoff = Math.round(EXPECTED_BACKOFFS_MAX_VALUES[attemptNumber - 1]);
assertTrue(backoff >= 0 && backoff <= expectedBackoff,
String.format("Attempt %d: backoff should be between 0 ms and %d ms, got: %d", attemptNumber,
expectedBackoff, backoff));
}
}

@Test
void testCalculateTransactionBackoffMsRespectsMaximum() {
for (int attemptNumber = 1; attemptNumber < EXPECTED_BACKOFFS_MAX_VALUES.length * 2; attemptNumber++) {
long backoff = ExponentialBackoff.calculateTransactionBackoffMs(attemptNumber);
assertTrue(backoff >= 0 && backoff <= ExponentialBackoff.TRANSACTION_MAX_MS,
String.format("Attempt %d: backoff should be capped at %f ms, got: %d ms",
Comment on lines +46 to +50
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The "Even at high attempt numbers, backoff should never exceed ExponentialBackoff.TRANSACTION_MAX_MS" comment adds no information, as it repeats both the straightforward assertion in the code, as well as the assertion message. Let's remove the comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed

attemptNumber, ExponentialBackoff.TRANSACTION_MAX_MS, backoff));
}
}

@Test
void testCustomJitterWithOne() {
ExponentialBackoff.setTestJitterSupplier(() -> 1.0);
try {
for (int attemptNumber = 1; attemptNumber <= EXPECTED_BACKOFFS_MAX_VALUES.length; attemptNumber++) {
long backoff = ExponentialBackoff.calculateTransactionBackoffMs(attemptNumber);
long expected = Math.round(EXPECTED_BACKOFFS_MAX_VALUES[attemptNumber - 1]);
assertEquals(expected, backoff,
String.format("Attempt %d: with jitter=1.0, backoff should be %d ms", attemptNumber, expected));
}
} finally {
ExponentialBackoff.clearTestJitterSupplier();
}
}

@Test
void testCustomJitterWithZero() {
ExponentialBackoff.setTestJitterSupplier(() -> 0.0);
try {
for (int attemptNumber = 1; attemptNumber <= EXPECTED_BACKOFFS_MAX_VALUES.length; attemptNumber++) {
long backoff = ExponentialBackoff.calculateTransactionBackoffMs(attemptNumber);
assertEquals(0, backoff, "With jitter=0, backoff should always be 0 ms");
}
} finally {
ExponentialBackoff.clearTestJitterSupplier();
}
}
Comment on lines +55 to +81
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • The "Test with..." comments are here seemingly to add structure to the code. Instead of using comments, we should either split this into two tests, or, use assertAll.
  • The "all backoffs should be 0" comment adds no information, as it repeats both the straightforward assertion in the code, as well as the assertion message.

Let's remove the comments and use more proper tools to structure the code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

split into two tests

}

This file was deleted.

Loading