Fix unit test that was failing on replica sets due to replication lag.