Copilot commented on code in PR #8720:
URL: https://github.com/apache/hbase/pull/8720#discussion_r4143491544


##########
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestWALInputFormat.java:
##########
@@ -99,6 +102,45 @@ public void testAddFile() {
     assertEquals(9, lfss.size());
   }
 
+  @Test
+  public void testSkipsArchivedMasterLocalWALs() throws Exception {
+    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
+    conf.set(WALPlayer.INPUT_FILES_SEPARATOR_KEY, ",");
+    conf.setLong(WALInputFormat.START_TIME_KEY, 200);
+    conf.setLong(WALInputFormat.END_TIME_KEY, 300);
+    FileSystem fs = TEST_UTIL.getTestFileSystem();
+    Path inputDir = TEST_UTIL.getDataTestDirOnTestFS("master-local-wals");
+    Path nonEmpty = new Path(inputDir, "master.250$masterlocalwal$");
+    Path empty = new Path(inputDir, "nested/master.251$masterlocalwal$");
+    List<String> expected =
+      Arrays.asList("0000000000000016310", "server.250", "server.250.meta", 
"server.250.syncrep");
+    try {
+      for (String name : expected) {
+        try (FSDataOutputStream out = fs.create(new Path(inputDir, "nested/" + 
name))) {

Review Comment:
   `getDataTestDirOnTestFS("master-local-wals")` only returns a path; it does 
not create `inputDir` or its `nested` child. On the test filesystem, this 
`create` therefore fails with a missing-parent `FileNotFoundException` before 
the input-format behavior is exercised. Create the directory tree before 
writing the fixtures.



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

Reply via email to