summaryrefslogtreecommitdiff
path: root/jstests/libs
diff options
context:
space:
mode:
authorMindaugas Malinauskas <mindaugas.malinauskas@mongodb.com>2021-06-29 17:55:00 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-20 10:37:07 +0000
commit23e56121a014719f0dd29d27a60a72a0e11dac10 (patch)
treef8ba7f2741ad051f9745544409e83554bb51af3d /jstests/libs
parenta3b9fc2924e1b5be041716038ba81759a667a5a3 (diff)
downloadmongo-23e56121a014719f0dd29d27a60a72a0e11dac10.tar.gz
SERVER-57321 Make $mod match expression handle NaN, Infinity and large values
Diffstat (limited to 'jstests/libs')
-rw-r--r--jstests/libs/sbe_assert_error_override.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/libs/sbe_assert_error_override.js b/jstests/libs/sbe_assert_error_override.js
index d42eddd5442..80eee699e44 100644
--- a/jstests/libs/sbe_assert_error_override.js
+++ b/jstests/libs/sbe_assert_error_override.js
@@ -113,6 +113,8 @@ const equivalentErrorCodesList = [
[5338802, 5439016],
[5687301, 5687400],
[5687302, 5687401],
+ [5732100, 5732102],
+ [5732101, 5732102],
];
// This map is generated based on the contents of 'equivalentErrorCodesList'. This map should _not_
@@ -180,6 +182,13 @@ assert.writeErrorWithCode = function(res, expectedCode, msg) {
return assertWriteErrorWithCodeOriginal(res, lookupEquivalentErrorCodes(expectedCode), msg);
};
+// Override the assert.throwsWithCode() function.
+const assertThrowsWithCodeOriginal = assert.throwsWithCode;
+assert.throwsWithCode = function(func, expectedCode, params, msg) {
+ return assertThrowsWithCodeOriginal(
+ func, lookupEquivalentErrorCodes(expectedCode), params, msg);
+};
+
// NOTE: Consider using 'assert.commandFailedWithCode' and 'assert.writeErrorWithCode' instead.
// This function should be only used when error code does not come from command. For instance, when
// validating explain output, which includes error code in the execution stats.