smengcl commented on code in PR #6859:
URL: https://github.com/apache/ozone/pull/6859#discussion_r1676545254


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java:
##########
@@ -676,49 +693,87 @@ private void runConcurrentWriteHSync(Path file,
       while ((Time.monotonicNow() - start < 10000)) {
         try {
           out.hsync();
-        } catch (IOException e) {
+        } catch (Exception e) {
           syncerException.set(e);
           throw new RuntimeException(e);
         }
       }
     };
 
     Thread writerThread = new Thread(writer);
+    writerThread.setName("Writer");
     writerThread.start();
-    Thread syncThread = new Thread(syncer);
-    syncThread.start();
+    Thread[] syncThreads = new Thread[syncThreadsCount];
+    for (int i = 0; i < syncThreadsCount; i++) {
+      syncThreads[i] = new Thread(syncer);
+      syncThreads[i].setName("Syncer-" + i);
+      syncThreads[i].start();
+    }
+
     writerThread.join();
-    syncThread.join();
+    for (Thread sync : syncThreads) {
+      sync.join();
+    }
 
     if (writerException.get() != null) {
       throw writerException.get();
     }
     if (syncerException.get() != null) {
       throw syncerException.get();
     }
+    return writes.get();
   }
 
-  @Test
-  public void testConcurrentWriteHSync()
-      throws IOException, InterruptedException {
-    final String rootPath = String.format("%s://%s/",
-        OZONE_OFS_URI_SCHEME, CONF.get(OZONE_OM_ADDRESS_KEY));
+  public static Stream<Arguments> concurrentWriteHSync() {
+    return Stream.of(
+        Arguments.of(1, 1, true),
+        Arguments.of(2, 1, true),
+        Arguments.of(4, 1, true),
+        Arguments.of(6, 2, true),
+        Arguments.of(8, 2, true),
+        Arguments.of(8, 3, true),
+        Arguments.of(8, 4, true),
+        Arguments.of(8, 8, true),
+        Arguments.of(8, 16, true),
+
+        Arguments.of(1, 1, false),
+        Arguments.of(8, 2, false),
+        Arguments.of(8, 16, false)
+    );

Review Comment:
   I wonder how long does it take in GitHub CI just to run this test suite with 
all those sets of params? If it takes too long we can moderately reduce param 
variations later.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org

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


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

Reply via email to