Skip to content

Commit 2af99b6

Browse files
committed
Make tests resilient to "ns not found" not being at the start of the error message
1 parent 1656cf6 commit 2af99b6

File tree

1 file changed

+2
-2
lines changed
  • driver-async/src/test/functional/com/mongodb/async/client

1 file changed

+2
-2
lines changed

driver-async/src/test/functional/com/mongodb/async/client/Fixture.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static MongoCollection<Document> initializeCollection(final MongoNamespac
117117
database.runCommand(new Document("drop", namespace.getCollectionName()), futureResultCallback);
118118
futureResultCallback.get(60, SECONDS);
119119
} catch (MongoCommandException e) {
120-
if (!e.getErrorMessage().startsWith("ns not found")) {
120+
if (!e.getErrorMessage().contains("ns not found")) {
121121
throw e;
122122
}
123123
} catch (Throwable t) {
@@ -141,7 +141,7 @@ public static void dropDatabase(final String name) {
141141
.runCommand(new Document("dropDatabase", 1), futureResultCallback);
142142
futureResultCallback.get(60, SECONDS);
143143
} catch (MongoCommandException e) {
144-
if (!e.getErrorMessage().startsWith("ns not found")) {
144+
if (!e.getErrorMessage().contains("ns not found")) {
145145
throw e;
146146
}
147147
} catch (Throwable t) {

0 commit comments

Comments
 (0)