refactor test to consume after all messages are produced