Skip to content

Commit 4b9a565

Browse files
committed
Make the new tests work when run against MongoDB 6
1 parent 391c317 commit 4b9a565

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ private static void errorPropagationAfterEncounteringMultipleErrors(
482482
Predicate<CommandEvent> configureFailPointEventMatcher = event -> {
483483
if (event instanceof CommandFailedEvent) {
484484
CommandFailedEvent commandFailedEvent = (CommandFailedEvent) event;
485+
if (commandFailedEvent.getCommandName().equals("drop")) {
486+
// this code may run against MongoDB 6, where dropping a nonexistent collection results in an error
487+
return false;
488+
}
485489
MongoException cause = assertInstanceOf(MongoException.class, commandFailedEvent.getThrowable());
486490
assertEquals(91, cause.getCode());
487491
return true;

0 commit comments

Comments
 (0)