diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2020-03-11 10:57:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-11 18:51:33 +0000 |
commit | 7bc67e98ce7d93d27d68d0da5220db61a035987e (patch) | |
tree | 4dbcc00dc8f73ef840b83093cbe65b519d6c5576 /jstests | |
parent | e0077e34ae71580f99205db961980f0403665652 (diff) | |
download | mongo-7bc67e98ce7d93d27d68d0da5220db61a035987e.tar.gz |
SERVER-46795 Allow for JS interrupt in mr_bigobject_replace.js
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/mr_bigobject_replace.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/jstests/core/mr_bigobject_replace.js b/jstests/core/mr_bigobject_replace.js index 268b7f1dd12..e9fc2c0aba3 100644 --- a/jstests/core/mr_bigobject_replace.js +++ b/jstests/core/mr_bigobject_replace.js @@ -56,10 +56,19 @@ function runTest(testOptions) { }, testOptions)); - assert.commandFailed(res, "creating a document larger than 16MB didn't fail"); - assert.lte(0, - res.errmsg.indexOf("object to insert too large"), - "map-reduce command failed for a reason other than inserting a large document"); + // In most cases we expect this to fail because it tries to insert a document that is too large. + // In some cases we may see the javascript execution interrupted because it takes longer than + // our default time limit, so we allow that possibility. + assert.commandFailedWithCode(res, + [ErrorCodes.BadValue, ErrorCodes.Interrupted], + "creating a document larger than 16MB didn't fail"); + if (res.code != ErrorCodes.Interrupted) { + assert.lte( + 0, + res.errmsg.indexOf("object to insert too large"), + "map-reduce command failed for a reason other than inserting a large document: " + + tojson(res)); + } } runTest({reduce: createBigDocument}); |