Skip to content

Commit b7eed4c

Browse files
authored
Enable ignored tests. (#1428)
JAVA-5379
1 parent 28c6df9 commit b7eed4c

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

driver-core/src/main/com/mongodb/internal/operation/MixedBulkWriteOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ private BulkWriteTracker(final boolean retry, @Nullable final BulkWriteBatch bat
475475
attempt = 0;
476476
attempts = retry ? RetryState.RETRIES + 1 : 1;
477477
this.batch = batch;
478-
this.retryUntilTimeoutThrowsException = timeoutContext.hasTimeoutMS();;
478+
this.retryUntilTimeoutThrowsException = timeoutContext.hasTimeoutMS();
479479
}
480480

481481
boolean lastAttempt() {

driver-core/src/test/unit/com/mongodb/internal/async/function/RetryStateTest.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.mongodb.internal.TimeoutSettings;
2222
import com.mongodb.internal.async.function.LoopState.AttachmentKey;
2323
import com.mongodb.internal.operation.retry.AttachmentKeys;
24-
import org.junit.Ignore;
2524
import org.junit.jupiter.api.Assertions;
2625
import org.junit.jupiter.api.DisplayName;
2726
import org.junit.jupiter.api.Test;
@@ -331,14 +330,12 @@ void advanceOrThrowPredicateThrowsAfterFirstAttempt(final TimeoutContext timeout
331330
}));
332331
}
333332

334-
@Ignore // TODO (CSOT) update this
335333
@Test
336334
void advanceOrThrowPredicateThrowsTimeoutAfterFirstAttempt() {
337335
RetryState retryState = new RetryState(TIMEOUT_CONTEXT_EXPIRED_GLOBAL_TIMEOUT);
338336
RuntimeException predicateException = new RuntimeException() {
339337
};
340-
RuntimeException attemptException = new RuntimeException() {
341-
};
338+
RuntimeException attemptException = new MongoOperationTimeoutException(EXPECTED_TIMEOUT_MESSAGE);
342339
MongoOperationTimeoutException mongoOperationTimeoutException = assertThrows(MongoOperationTimeoutException.class,
343340
() -> retryState.advanceOrThrow(attemptException, (e1, e2) -> e2, (rs, e) -> {
344341
assertTrue(rs.isFirstAttempt());
@@ -347,7 +344,7 @@ void advanceOrThrowPredicateThrowsTimeoutAfterFirstAttempt() {
347344
}));
348345

349346
assertEquals(EXPECTED_TIMEOUT_MESSAGE, mongoOperationTimeoutException.getMessage());
350-
assertEquals(attemptException, mongoOperationTimeoutException.getCause());
347+
assertNull(mongoOperationTimeoutException.getCause());
351348
}
352349

353350
@ParameterizedTest
@@ -417,14 +414,13 @@ void advanceOrThrowTransformAfterFirstAttempt(final TimeoutContext timeoutContex
417414
}));
418415
}
419416

420-
@Ignore // TODO (CSOT) update this
421417
@Test
422418
void advanceOrThrowTransformThrowsTimeoutExceptionAfterFirstAttempt() {
423419
RetryState retryState = new RetryState(TIMEOUT_CONTEXT_EXPIRED_GLOBAL_TIMEOUT);
424-
RuntimeException attemptException = new RuntimeException() {
425-
};
426-
RuntimeException transformerResult = new RuntimeException() {
427-
};
420+
421+
RuntimeException attemptException = new MongoOperationTimeoutException(EXPECTED_TIMEOUT_MESSAGE);
422+
RuntimeException transformerResult = new RuntimeException();
423+
428424
MongoOperationTimeoutException mongoOperationTimeoutException =
429425
assertThrows(MongoOperationTimeoutException.class, () -> retryState.advanceOrThrow(attemptException,
430426
(e1, e2) -> {
@@ -439,7 +435,6 @@ void advanceOrThrowTransformThrowsTimeoutExceptionAfterFirstAttempt() {
439435

440436
assertEquals(EXPECTED_TIMEOUT_MESSAGE, mongoOperationTimeoutException.getMessage());
441437
assertEquals(transformerResult, mongoOperationTimeoutException.getCause());
442-
443438
}
444439

445440
@ParameterizedTest

0 commit comments

Comments
 (0)