Test was flaky because the flow can finish below it can be killed, therefore failing the test. Sleep for 1 minute instead to give plenty of time for the test.