ensure connections are closed (so all messages are fludshed to the broker) before testing message delivery