HDFS-6587. Bug in TestBPOfferService can cause test failure. (Contributed by Zhilei Xu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1604899 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-06-23 18:21:00 +00:00
parent a90a8b26e9
commit 9ddedbf3df
2 changed files with 8 additions and 4 deletions

View File

@ -697,6 +697,9 @@ Release 2.5.0 - UNRELEASED
HDFS-6580. FSNamesystem.mkdirsInt should call the getAuditFileInfo() HDFS-6580. FSNamesystem.mkdirsInt should call the getAuditFileInfo()
wrapper. (Zhilei Xu via wheat9) wrapper. (Zhilei Xu via wheat9)
HDFS-6587. Bug in TestBPOfferService can cause test failure. (Zhilei Xu
via Arpit Agarwal)
BREAKDOWN OF HDFS-2006 SUBTASKS AND RELATED JIRAS BREAKDOWN OF HDFS-2006 SUBTASKS AND RELATED JIRAS
HDFS-6299. Protobuf for XAttr and client-side implementation. (Yi Liu via umamahesh) HDFS-6299. Protobuf for XAttr and client-side implementation. (Yi Liu via umamahesh)

View File

@ -435,8 +435,9 @@ private Boolean get(DatanodeProtocolClientSideTranslatorPB mockNN) {
} }
private ReceivedDeletedBlockInfo[] waitForBlockReceived( private ReceivedDeletedBlockInfo[] waitForBlockReceived(
ExtendedBlock fakeBlock, final ExtendedBlock fakeBlock,
DatanodeProtocolClientSideTranslatorPB mockNN) throws Exception { final DatanodeProtocolClientSideTranslatorPB mockNN) throws Exception {
final String fakeBlockPoolId = fakeBlock.getBlockPoolId();
final ArgumentCaptor<StorageReceivedDeletedBlocks[]> captor = final ArgumentCaptor<StorageReceivedDeletedBlocks[]> captor =
ArgumentCaptor.forClass(StorageReceivedDeletedBlocks[].class); ArgumentCaptor.forClass(StorageReceivedDeletedBlocks[].class);
GenericTestUtils.waitFor(new Supplier<Boolean>() { GenericTestUtils.waitFor(new Supplier<Boolean>() {
@ -444,9 +445,9 @@ private ReceivedDeletedBlockInfo[] waitForBlockReceived(
@Override @Override
public Boolean get() { public Boolean get() {
try { try {
Mockito.verify(mockNN1).blockReceivedAndDeleted( Mockito.verify(mockNN).blockReceivedAndDeleted(
Mockito.<DatanodeRegistration>anyObject(), Mockito.<DatanodeRegistration>anyObject(),
Mockito.eq(FAKE_BPID), Mockito.eq(fakeBlockPoolId),
captor.capture()); captor.capture());
return true; return true;
} catch (Throwable t) { } catch (Throwable t) {