Skip to content

Commit

Permalink
try to make DruidCoordinatorTest deterministic (apache#2967)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 authored and fjy committed May 13, 2016
1 parent a9b721a commit 681ffdb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class DruidCoordinatorTest extends CuratorTestBase
@Before
public void setUp() throws Exception
{
taskMaster = EasyMock.createMock(LoadQueueTaskMaster.class);
druidServer = EasyMock.createMock(DruidServer.class);
serverInventoryView = EasyMock.createMock(SingleServerInventoryView.class);
databaseSegmentManager = EasyMock.createNiceMock(MetadataSegmentManager.class);
Expand Down Expand Up @@ -371,7 +372,9 @@ public void childEvent(
Assert.assertNotNull(dataSourceMap.get(dataSource));
// Simulated the adding of segment to druidServer during SegmentChangeRequestLoad event
// The load rules asks for 2 replicas, therefore 1 replica should still be pending
Assert.assertEquals(1L, dataSourceMap.get(dataSource).get());
while(dataSourceMap.get(dataSource).get() != 1L) {
Thread.sleep(50);
}

coordinator.stop();
leaderUnannouncerLatch.await();
Expand Down

0 comments on commit 681ffdb

Please sign in to comment.