@@ -201,25 +201,23 @@ function generateTopologyTests(testSuites, testContext, filter) {
201
201
beforeEach ( beforeEachFilter ) ;
202
202
beforeEach ( ( ) => prepareDatabaseForSuite ( testSuite , testContext ) ) ;
203
203
afterEach ( ( ) => testContext . cleanupAfterSuite ( ) ) ;
204
- if ( testSuite . name . includes ( 'fle2-' ) ) {
205
- for ( const spec of testSuite . tests ) {
206
- const mochaTest = it ( spec . description , async function ( ) {
207
- if ( spec . failPoint ) {
208
- await testContext . enableFailPoint ( spec . failPoint ) ;
209
- }
204
+ for ( const spec of testSuite . tests ) {
205
+ const mochaTest = it ( spec . description , async function ( ) {
206
+ if ( spec . failPoint ) {
207
+ await testContext . enableFailPoint ( spec . failPoint ) ;
208
+ }
210
209
211
- // run the actual test
212
- await runTestSuiteTest ( this . configuration , spec , testContext ) ;
210
+ // run the actual test
211
+ await runTestSuiteTest ( this . configuration , spec , testContext ) ;
213
212
214
- if ( spec . failPoint ) {
215
- await testContext . disableFailPoint ( spec . failPoint ) ;
216
- }
213
+ if ( spec . failPoint ) {
214
+ await testContext . disableFailPoint ( spec . failPoint ) ;
215
+ }
217
216
218
- await validateOutcome ( spec , testContext ) ;
219
- } ) ;
220
- // Make the spec test available to the beforeEach filter
221
- mochaTest . spec = spec ;
222
- }
217
+ await validateOutcome ( spec , testContext ) ;
218
+ } ) ;
219
+ // Make the spec test available to the beforeEach filter
220
+ mochaTest . spec = spec ;
223
221
}
224
222
} ) ;
225
223
}
@@ -675,7 +673,7 @@ const kOperations = new Map([
675
673
const encryptedFields = operation . arguments . encryptedFields ;
676
674
const session = maybeSession ( operation , context ) ;
677
675
return db . dropCollection ( collectionName , { session, encryptedFields } ) . catch ( err => {
678
- if ( err . code !== MONGODB_ERROR_CODES . NamespaceNotFound ) {
676
+ if ( ! err . message . match ( / n s n o t f o u n d / ) ) {
679
677
throw err ;
680
678
}
681
679
} ) ;
@@ -762,7 +760,8 @@ const kOperations = new Map([
762
760
. then ( results => results . map ( ( { name } ) => name ) )
763
761
. then ( indexes => expect ( indexes ) . to . not . include ( indexName ) )
764
762
) . catch ( err => {
765
- if ( err . code !== MONGODB_ERROR_CODES . NamespaceNotFound ) {
763
+ // The error message can differ slightly with the same error code.
764
+ if ( ! err . message . match ( / n s n o t f o u n d | n s d o e s n o t e x i s t / ) ) {
766
765
throw err ;
767
766
}
768
767
} ) ;
0 commit comments