-
Type: Engineering Test
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
None
-
Replication
-
135
Our Antithesis testing uses the JavaScripts tests as a workload generator while replica set elections, data balancing, etc. are running in the background. JavaScript test assertion failures are ignored due to the testing infrastructure not able to retry operations sufficiently in the Antithesis environment. Some JavaScript tests exercise semantic correctness properties of the database where their test assertions are always valid.
1. We should expose a way to propagate high-value test assertion failures to Antithesis. One idea would be to introduce a function like
function expectAlwaysValidAndReportToAntithesis(func) { try { func() } catch (e) { print("ANTITHESIS-COMMAND: un-ignore"); throw e; } }
2. Audit and modify test assertions in the multi_statement_transaction*.js FSM workloads to wrap test assertions which are always valid in the function from (1). Here's an incomplete list of some relevant test assertions.
- https://github.com/mongodb/mongo/blob/032241e8b8c3ea9e05bbceb11581396e8570b98f/jstests/concurrency/fsm_workloads/multi_statement_transaction_simple.js#L24
- https://github.com/mongodb/mongo/blob/032241e8b8c3ea9e05bbceb11581396e8570b98f/jstests/concurrency/fsm_workloads/multi_statement_transaction_simple.js#L38
- https://github.com/mongodb/mongo/blob/032241e8b8c3ea9e05bbceb11581396e8570b98f/jstests/concurrency/fsm_workloads/multi_statement_transaction_simple.js#L61-L62
- https://github.com/mongodb/mongo/blob/495994310989ea7303d826270873689fab9617b9/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js#L76
- https://github.com/mongodb/mongo/blob/495994310989ea7303d826270873689fab9617b9/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js#L94-L97
- https://github.com/mongodb/mongo/blob/495994310989ea7303d826270873689fab9617b9/jstests/concurrency/fsm_workloads/multi_statement_transaction_atomicity_isolation.js#L128-L132
On failure the mongo shell would write to its stdout a message resembling the following.
[fsm_workload_test:multi_statement_transaction_simple] [tid:0] ANTITHESIS-COMMAND: un-ignore