mirror of https://github.com/apache/druid.git
Merge pull request #2119 from navis/fix-sporadic-testfail2
Fix sporadic fail of DruidCoordinatorTest#testCoordinatorRun
This commit is contained in:
commit
7b5fd76058
|
@ -247,6 +247,16 @@ public class DruidCoordinator
|
|||
return retVal;
|
||||
}
|
||||
|
||||
CountingMap<String> getLoadPendingDatasources() {
|
||||
final CountingMap<String> retVal = new CountingMap<>();
|
||||
for (LoadQueuePeon peon : loadManagementPeons.values()) {
|
||||
for (DataSegment segment : peon.getSegmentsToLoad()) {
|
||||
retVal.add(segment.getDataSource(), 1);
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public Map<String, Double> getLoadStatus()
|
||||
{
|
||||
Map<String, Double> loadStatus = Maps.newHashMap();
|
||||
|
|
|
@ -338,6 +338,10 @@ public class DruidCoordinatorTest extends CuratorTestBase
|
|||
Assert.assertEquals(1, segmentAvailability.size());
|
||||
Assert.assertEquals(0l, segmentAvailability.get(dataSource));
|
||||
|
||||
while (coordinator.getLoadPendingDatasources().get(dataSource).get() > 0) {
|
||||
Thread.sleep(50);
|
||||
}
|
||||
|
||||
Map<String, CountingMap<String>> replicationStatus = coordinator.getReplicationStatus();
|
||||
Assert.assertNotNull(replicationStatus);
|
||||
Assert.assertEquals(1, replicationStatus.entrySet().size());
|
||||
|
|
Loading…
Reference in New Issue