Feature: query-and-write readConcern parameter#615
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (1313+0 LOC, 10 files); LLM: Adds 205 new compatibility test cases across 9 files covering the readConcern parameter surface area for multiple read/write commands, which is a substantial multi-file test coverage expansion. If a label is wrong, remove it manually and ping |
Test cases: 205 (+ 9 replica_set skipped on standalone) Docs: https://www.mongodb.com/docs/v8.2/reference/read-concern/ Adds compatibility test coverage for the readConcern cross-cutting parameter, validating its full surface area across read commands (find, aggregate, count, distinct) and write commands (insert, update, delete, findAndModify) - from level acceptance and functional equivalence to full BSON type rejection matrix, invalid level strings, null coercion, snapshot/linearizable restrictions, command option interactions, empty/non-existent collections, views, cursor continuation (getMore), and afterClusterTime validation. 205 test cases across 9 files following project test guidelines. Signed-off-by: Ian Forster <forstaia@amazon.com>
Adds test_read_concern_local.py covering the MongoDB spec properties
for readConcern level 'local':
- Local is the implicit default: verify omitting readConcern produces
identical results to explicit {"level": "local"} for all 4 read
commands (find, aggregate, count, distinct).
- Available without session/transaction: confirm all 4 commands succeed
with 'local' in a plain context with no session, no transaction, and
no replica set requirement.
- Reads local state immediately: verify freshly-inserted documents are
visible under 'local' without propagation delay.
- Reflects mutations: verify 'local' sees in-place updates and deletions
applied to the local instance right away.
18 tests total (14 parametrized + 2 standalone).
Signed-off-by: Ian Forster <forstaia@amazon.com>
Align with PR documentdb#617 which replaced topology-coupled markers with capability-based precondition markers. Signed-off-by: Ian Forster <forstaia@amazon.com>
6f26257 to
6fa1aef
Compare
…n=False NOT_A_REPLICA_SET_ERROR for snapshot outside transaction is standalone- specific. On a replica set, this produces a different error. Gate the test so it only runs where cluster_read_concern is absent. Signed-off-by: Ian Forster <forstaia@amazon.com>
866cfcd to
6ff7b8b
Compare
eerxuan
left a comment
There was a problem hiding this comment.
- Cut the multi-command fan-out for the acceptance/validation axis in the cross-cutting dir. LEVEL_ACCEPTANCE_TESTS, NON_DOCUMENT_READ_CONCERN_TESTS, INVALID_LEVEL_TYPE_TESTS, INVALID_LEVEL_STRING_TESTS, null-coercion — these iterate ["find", "aggregate", "count", "distinct"] and duplicate what the per-command files already cover exhaustively. They should live per-command (and largely already do for count/distinct/aggregate).
- Keep the behavioral tests, collapsed to one representative command. The local/snapshot/linearizable semantic files are the legitimate cross-cutting content; pick one command (find is the natural representative) instead of repeating per command.
Per FOLDER_STRUCTURE.md, cross-cutting parameters that vary per command (readConcern, writeConcern) belong alongside the command tests. Move both directories from query_and_write/ into query_and_write/commands/ to match the existing structure used by insert, update, delete, etc. Import paths updated accordingly. All 620 tests collect cleanly. Signed-off-by: Ian Forster <forstaia@amazon.com>
eerxuan
left a comment
There was a problem hiding this comment.
🟠 The Major "per-command vs cross-cutting" coverage question from the original review still technically stands — the suite parametrizes acceptance/validation over [find, aggregate, count, distinct] in a shared
dir, while count/distinct/aggregate already have dedicated per-command readConcern files.
Please move read_concern back to /query_and_write/
This reverts commit b76f476. Signed-off-by: Ian Forster <forstaia@amazon.com>
#39
Test cases: 205 (+ 9 replica_set skipped on standalone)
Docs: https://www.mongodb.com/docs/v8.2/reference/read-concern/
Adds compatibility test coverage for the readConcern cross-cutting parameter, validating its full surface area across read commands (find, aggregate, count, distinct) and write commands (insert, update, delete, findAndModify) - from level acceptance and functional equivalence to full BSON type rejection matrix, invalid level strings, null coercion, snapshot/linearizable restrictions, command option interactions, empty/non-existent collections, views, cursor continuation (getMore), and afterClusterTime validation.
205 test cases across 9 files following project test guidelines.