From investigating a build failure, I concluded that it is possible that write done in safe_secondary_reads_single_migration_suspend_range_deletion.js might not have propagated to the secondary node.
Specifically, my hypothesis is that:
- The setUp here succeeded on a shard's primary node
- That write did not replicate yet to the secondary
- The read from aggregate went against the secondary node of the shard and did not find the document.
I have no way of proving that through the logs, but instead I want to make all setUp writes, like the one here use {w:2} write concern in order to ensure both nodes get the document before proceeding with the rest of the test.
Another more generic solution could be to call awaitReplication after the setUp call here in order to ensure all existing and future tests will wait.