Alter tests subject to intermittent failure on inconsistent dict ordering

fixes #592
Rather than having non-deterministic code, and checking for both possible results, it would be better to have deterministic code that we could make an explicit assertion about.

So, in this case, the obvious solutions are:
1. Have a test for both results, but have each test only trigger one of them.
2. Have a single test that only fails in one case.