There's a number of zio-kafka tests that are doing sleeps to wait for some condition to occur, which have a high risk of being flaky.
A better solution is to use a Promise to signal that some condition has occurred and await it somewhere else. Examples in the can stop one stream while keeping another one running test in ConsumerSpec