-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Fully Compatible
-
TIG 2018-02-26
SERVER-32497 and SERVER-32778 are two recent cases where accidentally calling tojson() in a loop impacts performance negatively enough to cause tests to fail. We could avoid this issue by changing the assertion functions to accept a function returning a string as the message parameter and only lazily calling the function if doassert() would be called. Note: The doassert() functions attempts to handle when the message parameter is a function; however, it is defeated by the assertion functions prefixing a string to the intended assertion message.
As part of this ticket, we should also update existing tests that define an object with a "toString" property as a way to define a function for getting the assertion message to just pass the function directly instead.
- is duplicated by
-
SERVER-29671 writeError should check that msg is a string
- Closed
-
SERVER-45506 Add custom generated messages for assert.soon & siblings
- Closed
- is related to
-
SERVER-32497 implicitly_retry_on_database_drop_pending.js calls tojson() inside of a loop
- Closed
-
SERVER-32778 Fix perf regression on shell assertions changes
- Closed
- related to
-
SERVER-33361 Update sasl_mechanism_discovery assertion to new signature
- Closed