Skip to content

Commit

Permalink
FLUME-2997. Fix flaky test in SpillableMemoryChannel
Browse files Browse the repository at this point in the history
When the mock sinks are slower than sources, testParallelSingleSourceAndSink sometimes fails.
In such situations the channel can get full, thus uncaught ChannelFullException breaks the test.

Since testCapacityWithOverflow was designed to cover such a scenario, we
can safely fix the test by increasing the channel capacity to make sure it won't get full.

This commit does the previously mentioned change.

Reviewers: Bessenyei Balázs Donát

(Attila Simon via Bessenyei Balázs Donát)
  • Loading branch information
Attila Simon authored and bessbd committed Oct 27, 2016
1 parent 9b65219 commit 7c4b2fd
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -805,7 +805,7 @@ public void testParallelMultipleSourcesAndSinks() throws InterruptedException {

Map<String, String> params = new HashMap<String, String>();
params.put("memoryCapacity", "0");
params.put("overflowCapacity", "500020");
params.put("overflowCapacity", String.valueOf(eventCount));
params.put("overflowTimeout", "3");
startChannel(params);

Expand All @@ -822,12 +822,11 @@ public void testParallelMultipleSourcesAndSinks() throws InterruptedException {

watch.elapsed();

System.out.println("Total puts " + channel.drainOrder.totalPuts);

System.out.println("Max Queue size " + channel.getMaxMemQueueSize());
System.out.println(channel.memQueue.size());

System.out.println("done");
Assert.assertEquals(eventCount, channel.drainOrder.totalPuts);
Assert.assertEquals("Channel not fully drained", 0, channel.getTotalStored());
System.out.println("testParallelMultipleSourcesAndSinks done");
}

static class StopWatch {
Expand Down

0 comments on commit 7c4b2fd

Please sign in to comment.