Avoid races in the shard testing.

Create a function that sorts the tests within the test output so
that no matter when the tests finish, the output will always be the
same.

This fixes flakiness in the test.

Test: Added an artificial sleep in a shard test that will be list first.
Test: Ran the normal set of unit tests hundreds of time.
Change-Id: Ie4e72c52578bf11eac0a1a1b830d6ab70975ca23
1 file changed