-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
None
-
Minor Change
-
TIG 2018-1-15, TIG 2018-1-29
-
0
I'm writing tests that use a variety of different commands and need to assert that they all fail with a particular code. However, the experience is extremely frustrating because the existing assert helpers all require a particular response format, and can't be used uniformly throughout:
- Error responses with a code field are caught by assert.commandWorked()
- Error responses with writeError are caught by assert.writeError()
- I have no idea if anyone can handle the plural writeErrors generated when using the bulk API
- Any other error response format I'm missing?
I would be very happy if we had one magic function that just "did the right thing" based on the response type / format.
- causes
-
SERVER-32778 Fix perf regression on shell assertions changes
- Closed
- is duplicated by
-
SERVER-32717 retryable_writes_mmap.js should use assert.commandFailedWithCode
- Closed
- is related to
-
SERVER-30879 assert.commandWorked() should check for writeConcernError()
- Closed