diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2018-12-12 11:16:13 -0500 |
---|---|---|
committer | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2019-01-07 22:54:19 -0500 |
commit | 09fdd6cd55bfaca9ac525f6a0668ed97a7f3d048 (patch) | |
tree | d402ff485f3ca1c26ad23535867c6525a6c40268 /jstests/core/batch_write_command_insert.js | |
parent | c2892222a633609fd14706062d8ed6086352004d (diff) | |
download | mongo-09fdd6cd55bfaca9ac525f6a0668ed97a7f3d048.tar.gz |
SERVER-38510 Set moreToCome flag with OP_MSG writes from shell
Diffstat (limited to 'jstests/core/batch_write_command_insert.js')
-rw-r--r-- | jstests/core/batch_write_command_insert.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/jstests/core/batch_write_command_insert.js b/jstests/core/batch_write_command_insert.js index 5d0a85fa763..feddcb50ea6 100644 --- a/jstests/core/batch_write_command_insert.js +++ b/jstests/core/batch_write_command_insert.js @@ -36,6 +36,16 @@ function resultNOK(result) { return !result.ok && typeof(result.code) == 'number' && typeof(result.errmsg) == 'string'; } +function countEventually(collection, n) { + assert.soon( + function() { + return collection.count() === n; + }, + function() { + return "unacknowledged write timed out"; + }); +} + // EACH TEST BELOW SHOULD BE SELF-CONTAINED, FOR EASIER DEBUGGING // @@ -69,7 +79,7 @@ request = { }; result = coll.runCommand(request); assert(resultOK(result), tojson(result)); -assert.eq(coll.count(), 1); +countEventually(coll, 1); var fields = ['ok']; assert.hasFields(result, fields, 'fields in result do not match: ' + tojson(fields)); |