Skip to content

Commit 0967483

Browse files
virajjasanitasanuma
authored andcommitted
HDFS-16184. De-flake TestBlockScanner#testSkipRecentAccessFile (#3329)
Reviewed-by: Ayush Saxena <ayushsaxena@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 1b9927a)
1 parent 3645a13 commit 0967483

File tree

1 file changed

+3
-0
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode

1 file changed

+3
-0
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,8 @@ public void testSkipRecentAccessFile() throws Exception {
10041004
TestScanResultHandler.getInfo(ctx.volumes.get(0));
10051005
synchronized (info) {
10061006
info.shouldRun = true;
1007+
info.sem = new Semaphore(1);
1008+
info.sem.acquire();
10071009
info.notify();
10081010
}
10091011
try {
@@ -1017,6 +1019,7 @@ public void testSkipRecentAccessFile() throws Exception {
10171019
LOG.debug("Timeout for all files are accessed in last period.");
10181020
}
10191021
synchronized (info) {
1022+
info.sem.release();
10201023
info.shouldRun = false;
10211024
info.notify();
10221025
}

0 commit comments

Comments
 (0)