rewrite tests to be more predictable