anujmodi2021 commented on code in PR #6676: URL: https://github.com/apache/hadoop/pull/6676#discussion_r1562021850
########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsClient.java: ########## @@ -102,11 +103,31 @@ public void testListPathWithValidListMaxResultsValues() setListMaxResults(listMaxResults); int expectedListResultsSize = listMaxResults > fileCount ? fileCount : listMaxResults; - Assertions.assertThat(listPath(directory.toString())).describedAs( - "AbfsClient.listPath result should contain %d items when " - + "listMaxResults is %d and directory contains %d items", - expectedListResultsSize, listMaxResults, fileCount) - .hasSize(expectedListResultsSize); + + AbfsRestOperation op = getFileSystem().getAbfsClient().listPath( + directory.toString(), false, getListMaxResults(), null, + getTestTracingContext(getFileSystem(), true)); + + List<ListResultEntrySchema> list = op.getResult().getListResultSchema().paths(); + String continuationToken = op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_CONTINUATION); + + if (continuationToken == null) { + // Listing is complete and number of objects should be same as expected + Assertions.assertThat(list) + .describedAs("AbfsClient.listPath() should return %d items" + + " when listMaxResults is %d, directory contains %d items and " + + "listing is complete", + expectedListResultsSize, listMaxResults, fileCount) + .hasSize(expectedListResultsSize); + } else { + // Listing is incomplete and number of objects can be lesser than expected Review Comment: Fixed ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsClient.java: ########## @@ -102,11 +103,31 @@ public void testListPathWithValidListMaxResultsValues() setListMaxResults(listMaxResults); int expectedListResultsSize = listMaxResults > fileCount ? fileCount : listMaxResults; - Assertions.assertThat(listPath(directory.toString())).describedAs( - "AbfsClient.listPath result should contain %d items when " - + "listMaxResults is %d and directory contains %d items", - expectedListResultsSize, listMaxResults, fileCount) - .hasSize(expectedListResultsSize); + + AbfsRestOperation op = getFileSystem().getAbfsClient().listPath( + directory.toString(), false, getListMaxResults(), null, + getTestTracingContext(getFileSystem(), true)); + + List<ListResultEntrySchema> list = op.getResult().getListResultSchema().paths(); + String continuationToken = op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_CONTINUATION); + + if (continuationToken == null) { + // Listing is complete and number of objects should be same as expected + Assertions.assertThat(list) + .describedAs("AbfsClient.listPath() should return %d items" + + " when listMaxResults is %d, directory contains %d items and " + + "listing is complete", + expectedListResultsSize, listMaxResults, fileCount) + .hasSize(expectedListResultsSize); + } else { + // Listing is incomplete and number of objects can be lesser than expected + Assertions.assertThat(list) + .describedAs("AbfsClient.listPath() should return %d items" + + " or lesser when listMaxResults is %d, directory contains" Review Comment: Fixed ########## hadoop-tools/hadoop-azure/src/site/markdown/testing_azure.md: ########## @@ -634,6 +631,8 @@ kept out of the source tree then referenced through an XInclude element: New files created in folder accountSettings is listed in .gitignore to prevent accidental cred leaks. +You are all set to run the test srcipt. Review Comment: Fixed -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org