Tests that threads run in the right order and with the right frequency.