Skip to content

ftp: avoid final InterfaceAddress mocks in passive-mode tests - #8341

Open
greenc-FNAL wants to merge 1 commit into
masterfrom
build/ftp-java25-compatibility
Open

greenc-FNAL wants to merge 1 commit into
masterfrom
build/ftp-java25-compatibility

Conversation

@greenc-FNAL

Copy link
Copy Markdown
Contributor

Motivation

java.net.InterfaceAddress is final on Java 25. The configured Mockito mock maker therefore cannot create the interface-address mocks used by the passive-mode FTP tests, even though source compilation still targets Java 21.

Modification

Add an InetAddress-based supplier and protected adapter hook for passive address selection, and use real immutable address values in the tests. Preserve the existing setAddressSupplier entry point, its null-clearing semantics, and delegation through the existing protected interface-address hook. Add regression coverage for those compatibility behaviors and close the EPSV test's passive handler reliably.

Result

The focused FTP tests no longer depend on mocking InterfaceAddress. Existing supplier callers and subclasses retain their adapter paths. This is an independent FTP compatibility/build-enabler PR, not a dependency-security upgrade.

Validation and prerequisite

The sole signed topic commit is ecd55c1c781e3c408d69f22a464bf8c736256b1c, based on dbb4fb0fe4236d25c8e993d92d3548d07f7bc005. Its patch is unchanged from the qualified FTP patch, as verified with git range-diff.

The local Maven 3.10 root reactor requires the separate frontend duplicate-dependency fix in #8339 before it can load the reactor model. This PR targets master, deliberately excludes that POM patch, and remains draft pending the foundation and requalification after it lands.

Qualification used only master at the stated SHA, the curator deduplication patch, and this FTP patch; it did not include the WebDAV fixture change or the dependency-security stack.

Java 21:

mvn -q -B -ntp -U -am clean test-compile -pl modules/dcache-ftp
mvn -q -B -ntp -U -am package -pl modules/dcache-ftp -DskipTests=false

Java 25 focused runtime qualification:

MAVEN_SKIP_RC=true JAVA_HOME="$(/usr/libexec/java_home -v 25)" mvn -q -B -ntp -U -am test -pl modules/dcache-ftp -DskipTests=false -Dtest=AbstractFtpDoorV1Test,ActiveAdapterTest -Dsurefire.failIfNoSpecifiedTests=false

Both FTP classes passed on Java 21 and Java 25: 44 + 2 tests, zero failures, errors, or skips. This does not claim a full Java 25 reactor pass or a deployed FTP/GridFTP qualification. The legacy-adapter and cleared-supplier regression cases are included in the class counts.

@greenc-FNAL
greenc-FNAL marked this pull request as ready for review December 3, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant