@Test
public void testBufferingAndResending() throws InterruptedException, IOException {
final ConcurrentLinkedQueue<Event> readEvents = new ConcurrentLinkedQueue<Event>();
final CountDownLatch countDownLatch = new CountDownLatch(4);
int port = MockFluentd.randomPort();
MockProcess mockProcess = new MockFluentd.MockProcess() {
public void process(MessagePack msgpack, Socket socket) throws IOException {
BufferedInputStream in = new BufferedInputStream(socket.getInputStream());
try {
Unpacker unpacker = msgpack.createUnpacker(in);
while (true) {