Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-26805 TestRegionHDFSBlockLocationFinder is flaky #4169

Merged
merged 1 commit into from
Mar 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down