summaryrefslogtreecommitdiff
path: root/jstests/libs
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs')
-rw-r--r--jstests/libs/global_snapshot_reads_util.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/jstests/libs/global_snapshot_reads_util.js b/jstests/libs/global_snapshot_reads_util.js
index be3421ea1c1..c1976d0218b 100644
--- a/jstests/libs/global_snapshot_reads_util.js
+++ b/jstests/libs/global_snapshot_reads_util.js
@@ -9,27 +9,25 @@ function verifyInvalidGetMoreAttempts(mainDb, collName, cursorId, lsid, txnNumbe
// Subsequent getMore requests without the same session id are rejected. The cursor should
// still be valid and usable after this failed attempt.
- assert.commandFailedWithCode(mainDb.runCommand({
- getMore: cursorId,
- collection: collName,
- batchSize: 1,
- txnNumber: NumberLong(txnNumber),
- lsid: {id: UUID()}
- }),
- 50801);
+ assert.commandFailedWithCode(
+ mainDb.runCommand(
+ {getMore: cursorId, collection: collName, batchSize: 1, lsid: {id: UUID()}}),
+ 50801);
// Reject getMores without txnNumber.
assert.commandFailedWithCode(
mainDb.runCommand({getMore: cursorId, collection: collName, batchSize: 1, lsid: lsid}),
50803);
- // Reject getMores without same txnNumber.
+ // Reject getMores without same txnNumber. This fails with NoSuchTransaction because the
+ // txnNumber 50 is higher than the active txnNumber for the session.
assert.commandFailedWithCode(mainDb.runCommand({
getMore: cursorId,
collection: collName,
batchSize: 1,
lsid: lsid,
- txnNumber: NumberLong(50)
+ txnNumber: NumberLong(50),
+ autocommit: false
}),
- 50804);
+ ErrorCodes.NoSuchTransaction);
}