HDFS-6470. TestBPOfferService.testBPInitErrorHandling is flaky. Contributed by Ming Ma.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1602491 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
99b18b0019
commit
7ce31cc100
|
@ -177,6 +177,9 @@ Release 2.5.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-6330. Move mkdirs() to FSNamesystem. (wheat9)
|
HDFS-6330. Move mkdirs() to FSNamesystem. (wheat9)
|
||||||
|
|
||||||
|
HDFS-6470. TestBPOfferService.testBPInitErrorHandling is flaky.
|
||||||
|
(Ming Ma via wang)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn)
|
HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn)
|
||||||
|
|
|
@ -325,15 +325,14 @@ public class TestBPOfferService {
|
||||||
}
|
}
|
||||||
}).when(mockDn).initBlockPool(Mockito.any(BPOfferService.class));
|
}).when(mockDn).initBlockPool(Mockito.any(BPOfferService.class));
|
||||||
BPOfferService bpos = setupBPOSForNNs(mockDn, mockNN1, mockNN2);
|
BPOfferService bpos = setupBPOSForNNs(mockDn, mockNN1, mockNN2);
|
||||||
|
List<BPServiceActor> actors = bpos.getBPServiceActors();
|
||||||
|
assertEquals(2, actors.size());
|
||||||
bpos.start();
|
bpos.start();
|
||||||
try {
|
try {
|
||||||
waitForInitialization(bpos);
|
waitForInitialization(bpos);
|
||||||
List<BPServiceActor> actors = bpos.getBPServiceActors();
|
// even if one of the actor initialization fails, the other one will be
|
||||||
// even if one of the actor initialization fails also other will be
|
// finish block report.
|
||||||
// running until both failed.
|
waitForBlockReport(mockNN1, mockNN2);
|
||||||
assertEquals(2, actors.size());
|
|
||||||
BPServiceActor actor = actors.get(0);
|
|
||||||
waitForBlockReport(actor.getNameNodeProxy());
|
|
||||||
} finally {
|
} finally {
|
||||||
bpos.stop();
|
bpos.stop();
|
||||||
}
|
}
|
||||||
|
@ -410,6 +409,31 @@ public class TestBPOfferService {
|
||||||
}, 500, 10000);
|
}, 500, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void waitForBlockReport(
|
||||||
|
final DatanodeProtocolClientSideTranslatorPB mockNN1,
|
||||||
|
final DatanodeProtocolClientSideTranslatorPB mockNN2)
|
||||||
|
throws Exception {
|
||||||
|
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
||||||
|
@Override
|
||||||
|
public Boolean get() {
|
||||||
|
return get(mockNN1) || get(mockNN2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Boolean get(DatanodeProtocolClientSideTranslatorPB mockNN) {
|
||||||
|
try {
|
||||||
|
Mockito.verify(mockNN).blockReport(
|
||||||
|
Mockito.<DatanodeRegistration>anyObject(),
|
||||||
|
Mockito.eq(FAKE_BPID),
|
||||||
|
Mockito.<StorageBlockReport[]>anyObject());
|
||||||
|
return true;
|
||||||
|
} catch (Throwable t) {
|
||||||
|
LOG.info("waiting on block report: " + t.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 500, 10000);
|
||||||
|
}
|
||||||
|
|
||||||
private ReceivedDeletedBlockInfo[] waitForBlockReceived(
|
private ReceivedDeletedBlockInfo[] waitForBlockReceived(
|
||||||
ExtendedBlock fakeBlock,
|
ExtendedBlock fakeBlock,
|
||||||
DatanodeProtocolClientSideTranslatorPB mockNN) throws Exception {
|
DatanodeProtocolClientSideTranslatorPB mockNN) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue