HDFS-16184. De-flake TestBlockScanner#testSkipRecentAccessFile (#3329)

Reviewed-by: Ayush Saxena <ayushsaxena@apache.org>
Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
This commit is contained in:
Viraj Jasani 2021-08-25 14:07:25 +05:30 committed by GitHub
parent c8e5864838
commit 1b9927afe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1004,6 +1004,8 @@ public class TestBlockScanner {
TestScanResultHandler.getInfo(ctx.volumes.get(0));
synchronized (info) {
info.shouldRun = true;
info.sem = new Semaphore(1);
info.sem.acquire();
info.notify();
}
try {
@ -1017,6 +1019,7 @@ public class TestBlockScanner {
LOG.debug("Timeout for all files are accessed in last period.");
}
synchronized (info) {
info.sem.release();
info.shouldRun = false;
info.notify();
}