jerryshao commented on code in PR #9282:
URL: https://github.com/apache/gravitino/pull/9282#discussion_r2587859362


##########
catalogs/catalog-fileset/src/test/java/org/apache/gravitino/catalog/fileset/TestFilesetCatalogOperations.java:
##########
@@ -1868,6 +1872,41 @@ public void testGetTargetLocation() throws IOException {
     }
   }
 
+  @Test
+  void testGetFileSystemWithTimeout() throws Exception {
+    FieldUtils.writeField(
+        GravitinoEnv.getInstance(), "entityStore", new 
RelationalEntityStore(), true);
+
+    FilesetCatalogOperations filesetCatalogOperations = new 
FilesetCatalogOperations();
+
+    LocalFileSystemProvider localFileSystemProvider = 
Mockito.mock(LocalFileSystemProvider.class);
+    when(localFileSystemProvider.scheme()).thenReturn("file");
+    when(localFileSystemProvider.getFileSystem(Mockito.any(Path.class), 
Mockito.anyMap()))
+        .thenAnswer(
+            invocation -> {
+              // Sleep 100s, however, the timeout is set to 6s by default in
+              // FilesetCatalogOperations, so
+              // it's expected to over within 10s
+              Thread.sleep(100000); // Simulate delay

Review Comment:
   Don't use sleep, it is too flaky, use awaitability.



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