You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/03/31 10:36:14 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #7253: Core: Fix flakiness in HadoopFileIOTest

nastra commented on code in PR #7253:
URL: https://github.com/apache/iceberg/pull/7253#discussion_r1154314288


##########
core/src/test/java/org/apache/iceberg/hadoop/HadoopFileIOTest.java:
##########
@@ -175,10 +181,16 @@ private List<Path> createRandomFiles(Path parent, int count) {
                 Path path = new Path(parent, "file-" + i);
                 paths.add(path);
                 fs.createNewFile(path);
+                createdFiles.increment();
               } catch (IOException e) {
                 throw new UncheckedIOException(e);
               }
             });
+
+    Awaitility.await()
+        .atMost(30, TimeUnit.SECONDS)
+        .untilAsserted(() -> Assertions.assertThat(createdFiles.intValue()).isEqualTo(count));
+
     return paths;

Review Comment:
   printing the created files in `testDeleteFiles` shows the `null` in `paths` which lead to the NPE:
   
   ```
   filesCreated = [null, file:/tmp/junit6934791194407302730/file-431529176, file:/tmp/junit6934791194407302730/file-1761283695, file:/tmp/junit6934791194407302730/file-1749940626, file:/tmp/junit6934791194407302730/file-892128508, file:/tmp/junit6934791194407302730/file-155629808, file:/tmp/junit6934791194407302730/file-1429008869, file:/tmp/junit6934791194407302730/file--1465154083, file:/tmp/junit6934791194407302730/file--138487339, file:/tmp/junit6934791194407302730/file--1242363800]
   ```



-- 
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-unsubscribe@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org