Port integration test speed and stability fixes from integration/1.2 - #1824
Merged
Conversation
Allocate coordinated loopback ports instead of sharing a fixed listener port, and make server unbind wait for accepted channels to close so test invocations cannot leak network activity into each other. Ported from integration/1.2 (53a3476). The unbind regression test is a subset of that branch's OpcTcpServerTransportTest; its reverse-connect test depends on code not yet on main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Run integration tests in two reusable forks while coordinating port allocation across JVMs. Reuse expensive certificate material and tighten cleanup so parallel execution remains deterministic. Ported from integration/1.2 (caf4baf), excluding the ECC session and Condition refresh changes, which depend on code not yet on main. Local integration test module time drops from ~69s to ~45s. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports two integration-test commits from
integration/1.2tomainrather than waiting for the distant merge:caf4baf10— Speed up and stabilize integration tests53a34760d— Stabilize transport network tests (Stabilize transport network tests #1822)Transport
OpcTcpServerTransport.unbind()now copies child channels out of the lock and closes them withsyncUninterruptibly(), making unbind a real teardown barrier instead of returning while accepted channels are still open. Bind channels usesyncUninterruptibly()too, replacing a loop that swallowedInterruptedException.TestPortAllocatorreserves loopback ports across test JVMs via file locks, replacing the fixed port12685shared byOpcTcpTransportTest.OpcTcpTransportTestthreads the allocated port through a newendpointUrl()helper and unbinds in@AfterEach.SDK integration tests
TestServerallocates its port throughTestPortAllocatorinstead of a random port with an unbounded recursive retry, and reuses the KeyStore plus both X509 identity certificates per JVM rather than generating three 2048-bit RSA keypairs on everyTestServer.create(). The keystore also moves from the shared$TMPDIR/securitypath to a per-JVM temp dir so parallel forks do not contend.SubscriptionTransferTestdisconnects its second client in afinally.Not ported
The
EccSessionIntegrationTestcertificate cache andConditionRefreshTestsynchronization hunks — both files are 1.2-only (ECC security policies, Alarms and Conditions).53a34760dplaced its regression test inOpcTcpServerTransportTest, a file introduced by the 1.2-only reverse connect work. Rather than port theunbind()change untested, that file is created here with onlyunbindClosesAcceptedChannelsBeforeReturningand itsServerApplicationContexthelper.Verification
mvn clean verifypasses, spotless clean. The new unbind test was confirmed to be a genuine regression test: with the oldunbind()body restored it fails onassertFalse(channel.isOpen()).Integration test module time on one machine: ~69s before, ~45s after. 270 tests, 0 failures.
Note:
TestServernow generates a fresh server certificate per JVM rather than reusing one persisted across runs. That is required for fork isolation and is harmless for these tests, but the server certificate is no longer stable between local runs.🤖 Generated with Claude Code