diff options
Diffstat (limited to 'jstests/sharding/retryable_write_error_labels.js')
| -rw-r--r-- | jstests/sharding/retryable_write_error_labels.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/jstests/sharding/retryable_write_error_labels.js b/jstests/sharding/retryable_write_error_labels.js index f4cf2db1a8e..23b0ff3c831 100644 --- a/jstests/sharding/retryable_write_error_labels.js +++ b/jstests/sharding/retryable_write_error_labels.js @@ -137,10 +137,6 @@ function testMongodError(errorCode, isWCError) { function testMongosError() { const shard0Primary = st.rs0.getPrimary(); - // Insert initial documents used by the test. - const docs = [{k: 0, x: 0}, {k: 1, x: 1}]; - assert.commandWorked(shard0Primary.getDB(dbName)[collName].insert(docs)); - // Test retryable writes. jsTestLog("Retryable write should return mongos shutdown error with RetryableWriteError label"); @@ -215,7 +211,7 @@ function testMongosError() { const sessionDb = session.getDatabase(dbName); const sessionColl = sessionDb.getCollection(collName); session.startTransaction(); - assert.commandWorked(sessionColl.update({k: 0}, {$inc: {x: 1}})); + assert.commandWorked(sessionColl.update({}, {$inc: {x: 1}})); return sessionDb.adminCommand({ commitTransaction: 1, txnNumber: NumberLong(session.getTxnNumber_forTesting()), @@ -252,7 +248,7 @@ function testMongosError() { const sessionDb = session.getDatabase(dbName); const sessionColl = sessionDb.getCollection(collName); session.startTransaction(); - assert.commandWorked(sessionColl.update({k: 1}, {$inc: {x: 1}})); + assert.commandWorked(sessionColl.update({}, {$inc: {x: 1}})); return sessionDb.adminCommand({ abortTransaction: 1, txnNumber: NumberLong(session.getTxnNumber_forTesting()), |
