From af49b8736753da8dbc543419828b58397e3862fb Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Sat, 27 Jun 2020 11:29:43 +0800 Subject: [PATCH] HBASE-24635 Addendum make test more robust --- .../org/apache/hadoop/hbase/client/TestShutdownOfMetaReplicaHolder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestShutdownOfMetaReplicaHolder.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestShutdownOfMetaReplicaHolder.java index f03ac2f585..11e5404ec5 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestShutdownOfMetaReplicaHolder.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestShutdownOfMetaReplicaHolder.java @@ -57,7 +57,7 @@ public class TestShutdownOfMetaReplicaHolder extends MetaWithReplicasTestBase { LOG.debug("Waiting for the replica {} to come up", hrl.getRegion()); TEST_UTIL.waitFor(30000, () -> { HRegionLocation loc = locator.getRegionLocations(HConstants.EMPTY_START_ROW, true).get(1); - return !loc.getServerName().equals(oldServer); + return loc != null && !loc.getServerName().equals(oldServer); }); LOG.debug("Replica {} is online on {}, old server is {}", hrl.getRegion(), locator.getRegionLocations(HConstants.EMPTY_START_ROW, true).get(1).getServerName(), -- 2.11.4.GIT