Describe the bug
ComponentClassLoaderTest.testOwnerFirstResourceFoundIgnoresComponent can fail in CI when java.io.tmpdir points to a path that contains dots, for example a temporary directory containing a version-like segment such as 1.0-SNAPSHOT.
In this case ComponentClassLoader#getResource(...) returns null, and the test fails because the loaded resource is expected to be the owner class loader resource.
Reproduction
Run the fluss-common test module with a temp directory whose path contains dots, for example:
mvn -pl fluss-common -Dtest=ComponentClassLoaderTest -Djava.io.tmpdir=/tmp/fluss-1.0-SNAPSHOT test
Root cause
The test uses the @TempDir absolute path as both the resource name and the owner-first package/resource prefix.
ComponentClassLoader converts package prefixes to resource path prefixes by replacing . with /. If the temp path contains a segment such as 1.0-SNAPSHOT, it is converted to 1/0-SNAPSHOT, so the owner-first resource prefix no longer matches the actual resource name. As a result, the owner-first resource lookup is skipped and getResource(...) returns null.
Expected behavior
The test should not depend on the formatting of the machine-specific temporary directory path. It should use a stable package/resource prefix and create an explicit test resource under the temp directory.
Affected test
fluss-common/src/test/java/org/apache/fluss/classloading/ComponentClassLoaderTest.java
Describe the bug
ComponentClassLoaderTest.testOwnerFirstResourceFoundIgnoresComponentcan fail in CI whenjava.io.tmpdirpoints to a path that contains dots, for example a temporary directory containing a version-like segment such as1.0-SNAPSHOT.In this case
ComponentClassLoader#getResource(...)returnsnull, and the test fails because the loaded resource is expected to be the owner class loader resource.Reproduction
Run the
fluss-commontest module with a temp directory whose path contains dots, for example:mvn -pl fluss-common -Dtest=ComponentClassLoaderTest -Djava.io.tmpdir=/tmp/fluss-1.0-SNAPSHOT testRoot cause
The test uses the
@TempDirabsolute path as both the resource name and the owner-first package/resource prefix.ComponentClassLoaderconverts package prefixes to resource path prefixes by replacing.with/. If the temp path contains a segment such as1.0-SNAPSHOT, it is converted to1/0-SNAPSHOT, so the owner-first resource prefix no longer matches the actual resource name. As a result, the owner-first resource lookup is skipped andgetResource(...)returnsnull.Expected behavior
The test should not depend on the formatting of the machine-specific temporary directory path. It should use a stable package/resource prefix and create an explicit test resource under the temp directory.
Affected test
fluss-common/src/test/java/org/apache/fluss/classloading/ComponentClassLoaderTest.java