Improve stability of the shardsCleanup test