I'm getting occasional test failures in provisioningserver.custom_hardware.tests.test_ucsm.TestGetFirstBooter.test_first_booter, like:
MismatchError: 'Entry100' != u'Entry98'
It looks as if the test sets up a bunch of "Entry%d" strings and expects get_first_booter to sort them numerically. But get_first_booter gets strings, not numbers, and sorts them lexicographically. Thus, when the test sets its arbitrary starting number at 98 it expects to see "Entry98, Entry99, Entry100" but gets "Entry100, Entry98, Entry99."
There's not a lot of documentation for get_first_booter, and none at all for the test and its setup, so I can't easily tell who's wrong. Is the test uncovering a bug in get_first_booter when it hits this edge condition? Or is the lexicographical order just fine and the test scenario bogus? This needs 1: clear code documentation to set expectations so we don't get surprised by these things, 2: specific tests for any edge conditions, and 3: a fix. And I really would do it in that order.