try to make DruidCoordinatorTest deterministic (#2967)

This commit is contained in:
Parag Jain 2016-05-13 16:43:28 -05:00 committed by Fangjin Yang
parent a9b721a01b
commit 681ffdb417
1 changed files with 4 additions and 1 deletions

View File

@ -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);
@ -371,7 +372,9 @@ public class DruidCoordinatorTest extends CuratorTestBase
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();