fix unit test for flat_wait