Use then to fix flakey tests