-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Testing
During the work on NODE-7219, several tests related to read preferences were identified as being ineffective, redundant, or potentially obsolete.
This ticket is to track the work required to clean up our test suite.
Ineffective Tests (Missing command method)
The following tests are outdated and don't test any actual functionality because the command method they target is missing on the Topology class. They currently pass without asserting the intended behavior.
- Should correctly apply collection level read Preference to count
- Should correctly apply collection level read Preference to aggregate
- Should correctly honor the readPreferences at DB and individual command level
2. Redundant Tests (Covered by TypeScript)
These tests were valuable in a JavaScript environment but are now redundant. Their primary purpose is to check input types, which is now handled more effectively and reliably by the TypeScript compiler at build time.
- Should correctly apply readPreferences specified as objects
- Should correctly pass readPreferences specified as objects to cursors
- Should correctly pass readPreferences specified as objects to collection methods
3. Tests for Potentially Deprecated Feature (Hedged Reads)
Hedged reads are deprecated in MongoDB Server version 8.0. This may impact the tests inside the hedge context block.
(we can't remove these until our min supported server version removes them)