Skip to content

Port: Http2MultiplexTransportTest: Fix possible SslContext leak in tests (#17597) - #17598

Merged
normanmaurer merged 1 commit into
5.0from
m5
Sep 25, 2026
Merged

normanmaurer merged 1 commit into
5.0from
m5

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

testSslException and testFireChannelReadAfterHandshakeSuccess only
released the server/client SslContext on the happy path, after
latch.await() returned successfully. If an exception was thrown
earlier (for example while binding or connecting), the SslContext and
the native OpenSSL key material it holds were never released
explicitly, and cleanup would only happen once the JVM finalizer ran.
This races with the leak presence detector's afterAll check and can
be reported as a flaky memory leak in this test class.

Modifications:

  • Release the SslContext instances in a finally block so they are
    always released, even if an exception is thrown.

Result:

Fix possible SslContext leak in unit tests.

…sts (#17597)

Motivation:

testSslException and testFireChannelReadAfterHandshakeSuccess only
released the server/client SslContext on the happy path, after
latch.await() returned successfully. If an exception was thrown
earlier (for example while binding or connecting), the SslContext and
the native OpenSSL key material it holds were never released
explicitly, and cleanup would only happen once the JVM finalizer ran.
This races with the leak presence detector's afterAll check and can
be reported as a flaky memory leak in this test class.

Modifications:

- Release the SslContext instances in a finally block so they are
  always released, even if an exception is thrown.

Result:

Fix possible SslContext leak in unit tests.
@testlens-app

testlens-app Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Build PR / windows-x86_64-java25-boringssl > Netty/Buffer

Test Runs Flakiness
SimpleLeakAwareByteBufTest > testToStringMultipleThreads() ❌ 0% 🟢

🏷️ Commit: 1d80c46
▶️ Tests: 205519 executed
⚪️ Checks: 12/12 completed

Test Failures

SimpleLeakAwareByteBufTest > testToStringMultipleThreads() (Netty/Buffer in Build PR / windows-x86_64-java25-boringssl)
java.util.concurrent.TimeoutException
	at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:259)
	at java.base/java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:437)
	at io.netty.buffer.AbstractByteBufTest$30.run(AbstractByteBufTest.java:2316)
	at java.base/java.lang.Thread.run(Thread.java:1474)
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:252)
		... 3 more
	Suppressed: java.util.concurrent.BrokenBarrierException
		at java.base/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:210)
		... 3 more

Rerun Controls

Select tests to mute in this pull request:

  • SimpleLeakAwareByteBufTest > testToStringMultipleThreads()

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Sep 25, 2026
@normanmaurer
normanmaurer merged commit 6230827 into 5.0 Sep 25, 2026
12 of 13 checks passed
@normanmaurer
normanmaurer deleted the m5 branch September 25, 2026 14:28
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