chungen0126 commented on code in PR #7047:
URL: https://github.com/apache/ozone/pull/7047#discussion_r1724676403
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java:
##########
@@ -667,6 +675,99 @@ static void runTestHSync(FileSystem fs, Path file,
}, 500, 3000);
}
+
+ public static Stream<Arguments> concurrentExceptionHandling() {
+ return Stream.of(
+ Arguments.of(4, 1),
+ Arguments.of(4, 4),
+ Arguments.of(8, 4)
+ );
+ }
+
+ @ParameterizedTest
+ @MethodSource("concurrentExceptionHandling")
+ public void testConcurrentExceptionHandling(int syncerThreads, int errors)
throws Exception {
+ final String rootPath = String.format("%s://%s/", OZONE_OFS_URI_SCHEME,
CONF.get(OZONE_OM_ADDRESS_KEY));
+ CONF.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, rootPath);
+
+ ErrorInjectorImpl errorInjector = new ErrorInjectorImpl();
+ XceiverClientManager.enableErrorInjection(errorInjector);
+
+ final String dir = OZONE_ROOT + bucket.getVolumeName() +
OZONE_URI_DELIMITER + bucket.getName();
+
+ try (FileSystem fs = FileSystem.get(CONF)) {
+ final Path file = new Path(dir, "exceptionhandling");
+ byte[] data = new byte[8];
+ ThreadLocalRandom.current().nextBytes(data);
+ int writes;
+ try (FSDataOutputStream out = fs.create(file, true)) {
+ writes = runConcurrentWriteHSyncWithException(file, out, data,
syncerThreads, errors, errorInjector);
+ }
+ validateWrittenFile(file, fs, data, writes);
+ fs.delete(file, false);
Review Comment:
> seems to be failing consistently: TestHSync.testUncommittedBlocks:515
expected: but was:
>
> I wonder if it's related to the new commit just merged #7074
To address the failure in `TestHsync#testUncommittedBlocks`, ensure that the
`deletedTable` is empty after `fs.delete(file, false)`;
Rebase to master and add a line after `fs.delete(file, false);` to wait
`KeyDeletingService` to clean up the `deletedTable`.
```
waitForEmptyDeletedTable();
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]