The sharding_balance4.js test fails occasionally because more than 5 migrations manage to complete since the write operation started and because of this the write never manages to establish a shard version.
We should ignore up to certain number of NoProgressMade errors in order to make the test less likely to fail. This doesn't fix the inherent raciness though.