From 8deced0073aedb4526dcdab7b65ee06cf2a26019 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Tue, 30 Jul 2019 22:17:39 +0530 Subject: [PATCH] HDFS-14677. TestDataNodeHotSwapVolumes#testAddVolumesConcurrently fails intermittently in trunk. Contributed by Chen Zhang. --- .../hdfs/server/datanode/TestDataNodeHotSwapVolumes.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeHotSwapVolumes.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeHotSwapVolumes.java index e72c499624..d98047f47f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeHotSwapVolumes.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeHotSwapVolumes.java @@ -549,7 +549,8 @@ public void testAddVolumesConcurrently() dn.data = Mockito.spy(data); final int newVolumeCount = 40; - List addVolumeDelayedThreads = new ArrayList<>(); + List addVolumeDelayedThreads = + Collections.synchronizedList(new ArrayList<>()); AtomicBoolean addVolumeError = new AtomicBoolean(false); AtomicBoolean listStorageError = new AtomicBoolean(false); CountDownLatch addVolumeCompletionLatch =