Skip to content

Commit e0a657b

Browse files
authored
CSHARP-5648: Fix ClientEncryptionProseTests.BypassSpawningMongocryptdViaMongocryptdBypassSpawnTest (#1734)
1 parent d18dbec commit e0a657b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/MongoDB.Driver.Tests/Specifications/client-side-encryption/prose-tests/ClientEncryptionProseTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public void BypassSpawningMongocryptdViaMongocryptdBypassSpawnTest(
421421
var coll = GetCollection(clientEncrypted, __collCollectionNamespace);
422422
var exception = Record.Exception(() => Insert(coll, async, new BsonDocument("encrypted", "test")));
423423

424-
AssertInnerEncryptionException<TimeoutException>(exception, "A timeout occurred after 10000ms selecting a server");
424+
AssertInnerEncryptionExceptionRegex<TimeoutException>(exception, "A timeout occurred after \\d+ms selecting a server");
425425
}
426426
}
427427

@@ -2904,6 +2904,10 @@ private void AssertInnerEncryptionException<TInnerException>(Exception ex, strin
29042904
where TInnerException : Exception
29052905
=> AssertInnerEncryptionException<TInnerException>(ex, e => e.Message.Should().Contain(exceptionMessageContains));
29062906

2907+
private void AssertInnerEncryptionExceptionRegex<TInnerException>(Exception ex, string exceptionMessageRegex)
2908+
where TInnerException : Exception
2909+
=> AssertInnerEncryptionException<TInnerException>(ex, e => e.Message.Should().MatchRegex(exceptionMessageRegex));
2910+
29072911
private IMongoClient ConfigureClient(
29082912
bool clearCollections = true,
29092913
int? maxPoolSize = null,

0 commit comments

Comments
 (0)