Ensure deterministic ordering of tests

closes #1532