SERVER-23316 for this previously, but it is closed and only addressed tests as they failed.
This failures pops up now and then on different tests. This ticket is to address all the JS tests at once, before they fail. Backport to v3.4 should be pretty easy since we just branched recently, so we should do it.
Failures have occurred on 3.5, 3.4, 3.2, 3.0.
- is related to
SERVER-23316 Sharding tests should not rely on the order of entries returned when querying the config.shards collection