test_flow fix: replace delays with condition