On my old dual core Macbook this test sometimes fails because the listener has a four second wait and the test only allocates five seconds for processing of the messages to complete after the producer transaction commit is called.