diff --git a/java/flight/src/test/java/org/apache/arrow/flight/TestServerOptions.java b/java/flight/src/test/java/org/apache/arrow/flight/TestServerOptions.java index e3ac3908941..c745de912f3 100644 --- a/java/flight/src/test/java/org/apache/arrow/flight/TestServerOptions.java +++ b/java/flight/src/test/java/org/apache/arrow/flight/TestServerOptions.java @@ -38,6 +38,9 @@ public void domainSocket() throws Exception { Assume.assumeTrue("We have a native transport available", FlightTestUtil.isNativeTransportAvailable()); final File domainSocket = File.createTempFile("flight-unit-test-", ".sock"); Assert.assertTrue(domainSocket.delete()); + // Domain socket paths have a platform-dependent limit. Set a conservative limit and skip the test if the temporary + // file name is too long. (We do not assume a particular platform-dependent temporary directory path.) + Assume.assumeTrue("The domain socket path is not too long", domainSocket.getAbsolutePath().length() < 100); final Location location = Location.forGrpcDomainSocket(domainSocket.getAbsolutePath()); try ( BufferAllocator a = new RootAllocator(Long.MAX_VALUE);