In theĀ dropAndRecreateTestCollection() function we wait while the _flushRoutingTableCacheUpdates internal command is present as curOp.
However it might happen as a race condition that the operation does not show up yet when we start to wait, so we won't wait for the filtering metadata refresh at all.
The solution is to forcefully refresh the metadata by issuing a _flushRoutingTableCacheUpdates command.