adoroszlai commented on code in PR #4778:
URL: https://github.com/apache/ozone/pull/4778#discussion_r1208914195


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java:
##########
@@ -160,6 +164,35 @@ public void testOfsHSync() throws Exception {
     }
   }
 
+  @Test
+  public void testOverwriteHSyncFile() throws Exception {
+    // Set the fs.defaultFS
+    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);
+
+    final String dir = OZONE_ROOT + bucket.getVolumeName()
+        + OZONE_URI_DELIMITER + bucket.getName();
+
+    try (FileSystem fs = FileSystem.get(CONF)) {
+      final Path file = new Path(dir, "file");
+      try (FSDataOutputStream os = fs.create(file, false)) {

Review Comment:
   ```
   Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 274.997 s 
<<< FAILURE! - in org.apache.hadoop.fs.ozone.TestHSync
   org.apache.hadoop.fs.ozone.TestHSync.testOverwriteHSyncFile  Time elapsed: 
0.101 s  <<< ERROR!
   org.apache.hadoop.fs.FileAlreadyExistsException: FILE_ALREADY_EXISTS: File 
file already exists
        at 
org.apache.hadoop.fs.ozone.BasicRootedOzoneClientAdapterImpl.createFile(BasicRootedOzoneClientAdapterImpl.java:401)
        at 
org.apache.hadoop.fs.ozone.BasicRootedOzoneFileSystem.createOutputStream(BasicRootedOzoneFileSystem.java:276)
        at 
org.apache.hadoop.fs.ozone.BasicRootedOzoneFileSystem.create(BasicRootedOzoneFileSystem.java:248)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1233)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1210)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1091)
        at 
org.apache.hadoop.fs.ozone.TestHSync.testOverwriteHSyncFile(TestHSync.java:179)
   ```



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

Reply via email to