Skip to content

Commit

Permalink
Ensure starting mock Fluentd
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed May 2, 2016
1 parent 871948d commit 10d57db
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -49,6 +49,7 @@ public void process(MessagePack msgpack, Socket socket) throws IOException {
}
});
fluentd.start();
fluentd.waitUntilReady();

// start asyncSenders
Sender asyncSender = new AsyncRawSocketSender("localhost", port);
Expand Down Expand Up @@ -111,6 +112,7 @@ public void process(MessagePack msgpack, Socket socket) throws IOException {
}
});
fluentd.start();
fluentd.waitUntilReady();

// start asyncSenders
Sender asyncSender = new AsyncRawSocketSender("localhost", port);
Expand Down Expand Up @@ -162,6 +164,7 @@ public void process(MessagePack msgpack, Socket socket) throws IOException {
}
});
fluentds[0].start();
fluentds[0].waitUntilReady();
ports[1] = MockFluentd.randomPort();
elists[1] = new ArrayList<Event>();
fluentds[1] = new MockFluentd(ports[1], new MockFluentd.MockProcess() {
Expand All @@ -180,6 +183,7 @@ public void process(MessagePack msgpack, Socket socket) throws IOException {
}
});
fluentds[1].start();
fluentds[1].waitUntilReady();

// start AsyncSenders
Sender[] asyncSenders = new Sender[2];
Expand Down Expand Up @@ -272,6 +276,7 @@ public void process(MessagePack msgpack, Socket socket) throws IOException {

MockFluentd fluentd = new MockFluentd(port, mockProcess);
fluentd.start();
fluentd.waitUntilReady();

Sender asyncSender = new AsyncRawSocketSender("localhost", port);
assertFalse(asyncSender.isConnected());
Expand Down Expand Up @@ -369,6 +374,7 @@ public void run() {
try {
bufferFull.await(20, TimeUnit.SECONDS);
fluentd.start();
fluentd.waitUntilReady();
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 10d57db

Please sign in to comment.