Merge pull request #1734 from metamx/test

fix broken integration-test
This commit is contained in:
Fangjin Yang 2015-09-15 11:35:18 -07:00
commit 518a1a3f9e
1 changed files with 3 additions and 1 deletions

View File

@ -137,6 +137,7 @@ public class EventReceiverFirehoseTestClient
// Test sending events using both jsonMapper and smileMapper.
// sends events one by one using both jsonMapper and smileMapper.
int totalEventsPosted = 0;
int expectedEventsPosted = 0;
while ((s = reader.readLine()) != null) {
events.add(
(Map<String, Object>) this.jsonMapper.readValue(
@ -151,10 +152,11 @@ public class EventReceiverFirehoseTestClient
: SmileMediaTypes.APPLICATION_JACKSON_SMILE;
totalEventsPosted += postEvents(events, mapper, mediaType);
;
expectedEventsPosted += events.size();
events = new ArrayList<>();
}
if (totalEventsPosted != events.size()) {
if (totalEventsPosted != expectedEventsPosted) {
throw new ISE("All events not posted, expected : %d actual : %d", events.size(), totalEventsPosted);
}
return totalEventsPosted;