Make non-deterministic tests deterministic