From 177ccbc43f8c5fcb2a5d90056f506253f42af320 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Mon, 2 Jul 2018 16:36:25 -0700 Subject: [PATCH] HDFS-13714. Fix TestNameNodePrunesMissingStorages test failures on Windows. Contributed by Lukas Majercak. (cherry picked from commit 7296b644f7c44400f03995668573a4cfd2ee552c) --- .../blockmanagement/TestNameNodePrunesMissingStorages.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestNameNodePrunesMissingStorages.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestNameNodePrunesMissingStorages.java index 96d227d1779..05b6d3023b3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestNameNodePrunesMissingStorages.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestNameNodePrunesMissingStorages.java @@ -294,8 +294,9 @@ public class TestNameNodePrunesMissingStorages { in = null; out.close(); out = null; - newVersionFile.renameTo(versionFile); - success = true; + // Delete old version file + success = versionFile.delete(); + success &= newVersionFile.renameTo(versionFile); } finally { if (in != null) { in.close();