-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Server Tooling & Methods
assert.throws() makes no effort to ensure that the exception that was thrown is the one that should have been thrown. There are lots of problems which can cause exceptions to be thrown, many of which are completely unrelated to what is being tested. If one of these problems is inadvertently introduced, assert.throws() will continue to succeed when it really ought to fail. Examples of this include SERVER-28547 and SERVER-21087.
It would be better if users of assert.throws() were forced to (somehow) declare the exception that is expected to occur (eg. via substring matching?).
- related to
-
SERVER-28547 sharding_continuous_config_stepdown suite doesn't actually step any nodes down
- Closed
-
SERVER-21087 Some uses of assert.throws() always pass
- Closed