You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ayushtkn (via GitHub)" <gi...@apache.org> on 2023/04/13 22:46:22 UTC
[GitHub] [ozone] ayushtkn commented on a diff in pull request #4564: HDDS-8370. Intermittent failure in TestOzoneFileSystem#testListStatusWithIntermediateDir
ayushtkn commented on code in PR #4564:
URL: https://github.com/apache/ozone/pull/4564#discussion_r1166095830
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystem.java:
##########
@@ -639,10 +641,16 @@ public void testListStatusWithIntermediateDir() throws Exception {
}, 1000, 120000);
}
- FileStatus[] fileStatuses = fs.listStatus(parent);
+ List<FileStatus> fileStatuses = new ArrayList<>(Arrays.asList(
+ fs.listStatus(parent)));
+ Path trashRoot = new Path(OZONE_URI_DELIMITER, TRASH_PREFIX);
+ fileStatuses.removeIf(f -> trashRoot.equals(f.getPath()));
Review Comment:
Can we not use the ``listStatus`` with ``PathFilter`` option rather than doing this filtering ourselves?
Something like or a better variant as you like
```
fs.listStatus(parent, path -> path.toString().startsWith("/.Trash"));
```
--
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@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org