-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
3
Replacing the DatabaseNameUtil::deserialize() tenantId assertions with invariants will allow us to examine sites in test infrastructure or in the binary that we may not have accounted for but would still otherwise allow tests to pass.
For example, we can trigger a crash doing this when list_indexes.js is run with the multitenancy_jscore_passthrough. At some point, we close the cursor which will issue killCursors commands, at this point with correct tenantIds. After closing the cursors and end of the test we attempt to access a closed cursor, which triggers an assertion as expected and caught. However, after the test has consumed the assertion (ie. after the test concludes), during cleanup some test infrastructure elsewhere issues another killCursors command, but because it was not part of this test it has no knowledge of the tenantId, and issues the command without a tenantId triggering the invariant.
It's likely that because this occurs after the test has exited, the assertion is never captured as a failure and allows the test to pass. It's possible there are several other similar cases that are highlighted by this exercise.