DadanielZ commented on a change in pull request #2099:
URL: https://github.com/apache/hadoop/pull/2099#discussion_r445266567



##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestNativeAzureFileSystemConcurrencyLive.java
##########
@@ -130,15 +131,55 @@ public void testConcurrentDeleteFile() throws Exception {
     }
   }
 
+  /**
+   * Validate the bug fix for HADOOP-17089.  Please note that we were never
+   * able to reproduce this except during a Spark job that ran for multiple 
days
+   * and in a hacked-up azure-storage SDK that added sleep before and after
+   * the call to factory.setNamespaceAware(true) as shown in the description of
+   * https://github.com/Azure/azure-storage-java/pull/546.
+   */
+  @Test(timeout = TEST_EXECUTION_TIMEOUT)
+  public void testConcurrentList() throws Exception {
+    final Path testDir = new 
Path("/tmp/data-loss/11230174258112/_temporary/0/_temporary/attempt_20200624190514_0006_m_0");
+    final Path testFile = new Path(testDir, 
"part-00004-15ea87b1-312c-4fdf-1820-95afb3dfc1c3-a010.snappy.parquet");
+    fs.create(testFile).close();
+    List<ListTask> tasks = new ArrayList<>(THREAD_COUNT);
+
+    for (int i = 0; i < THREAD_COUNT; i++) {
+      tasks.add(new ListTask(fs, testDir));
+    }
+
+    ExecutorService es = null;
+    try {
+      es = Executors.newFixedThreadPool(THREAD_COUNT);
+
+      List<Future<Integer>> futures = es.invokeAll(tasks);
+
+      for (Future<Integer> future : futures) {
+        Assert.assertTrue(future.isDone());
+
+        // we are using Callable<V>, so if an exception
+        // occurred during the operation, it will be thrown
+        // when we call get
+        long fileCount = future.get();
+        assertEquals("The list should always contain 1 file.",1, fileCount);

Review comment:
       Yetus complains here:
   `assertEquals("The list should always contain 1 file.",1, fileCount);:62: 
',' is not followed by whitespace. [WhitespaceAfter]`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to