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


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/OzoneFileSystemTests.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.fs.ozone;
+
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeSet;
+
+import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_LISTING_PAGE_SIZE;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Common test cases for Ozone file systems.
+ */
+final class OzoneFileSystemTests {
+
+  private OzoneFileSystemTests() {
+    // no instances
+  }
+
+  /**
+   * Tests listStatusIterator operation on directory with different
+   * numbers of child directories.
+   */
+  public static void listStatusIteratorOnPageSize(OzoneConfiguration conf,
+      String rootPath) throws IOException {
+    final int pageSize = 32;
+    int[] dirCounts = {
+        1,
+        pageSize - 1,
+        pageSize,
+        pageSize + 1,
+        pageSize + pageSize / 2,
+        pageSize + pageSize
+    };
+    OzoneConfiguration config = new OzoneConfiguration(conf);
+    config.setInt(OZONE_FS_LISTING_PAGE_SIZE, pageSize);
+    URI uri = FileSystem.getDefaultUri(config);
+    config.setBoolean(
+        String.format("fs.%s.impl.disable.cache", uri.getScheme()), true);

Review Comment:
   > Even if it somehow picks older FS instance, it should still return all the 
entries as earlier page size was larger,
   
   The problem only happens when the FS picks up the smaller page size (either 
by setting it for the whole test class, or by disabling the FS cache).  When 
the initial FS (created in pre-test setup) with the larger page size is used, 
the test always passes.
   
   > could be an issue on the OM side itself
   
   I suspect the same.
   
   I guess the same was reported in HDDS-5012, too.



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