Fix non-determinism in distributed test