Skip to content
Permalink
Browse files
HBASE-26805 TestRegionHDFSBlockLocationFinder is flaky (#4169)
Signed-off-by: GeorryHuang <huangzhuoyue@apache.org>
  • Loading branch information
Apache9 committed Mar 7, 2022
1 parent 2b205d2 commit 480db06e46792f8e28e9fcc66be478bbaf901e01
Showing 1 changed file with 4 additions and 2 deletions.
@@ -209,7 +209,7 @@ public void testGetTopBlockLocations() {
}

@Test
public void testRefreshRegionsWithChangedLocality() {
public void testRefreshRegionsWithChangedLocality() throws InterruptedException {
ServerName testServer = ServerName.valueOf("host-0", 12345, 12345);
RegionInfo testRegion = REGIONS.get(0);

@@ -231,7 +231,9 @@ public void testRefreshRegionsWithChangedLocality() {

finder.setClusterMetrics(getMetricsWithLocality(testServer, testRegion.getRegionName(),
0.345f));

// there is no way to test whether the refresh for a guava cache is finished, so here we just
// add a one second sleep, usually this is enough for the refresh
Thread.sleep(1000);
// locality changed just for our test region, so it should no longer be the same
for (RegionInfo region : REGIONS) {
HDFSBlocksDistribution hbd = finder.getBlockDistribution(region);

0 comments on commit 480db06

Please sign in to comment.