GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Don't use the network in OcspClientTest.simpleOcspQueryTest by normanmaurer · Pull Request #17908 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Oct 19, 2026

Copy link
Copy Markdown
Member

Motivation:

OcspClientTest.simpleOcspQueryTest fetched the certificate chain from
https://apple.com and then sent the OCSP query to Apple's real
responder. This makes the test flaky whenever the network is unreliable,
which regularly happens on GitHub runners.

Modification:

  • Start a local Netty HTTP server on 127.0.0.1 that acts as OCSP
    responder. It parses the OCSP request and answers with a signed good
    response that echoes the nonce.
  • Generate the CA and server certificate with CertificateBuilder, with
    an OCSP URL that points to the local server.
  • Enable nonce validation in the test.

Result:

simpleOcspQueryTest only talks to localhost and no longer depends on
external hosts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
Don't use the network in OcspClientTest.simpleOcspQueryTest
8c008a7
Motivation:

`OcspClientTest.simpleOcspQueryTest` fetched the certificate chain from
`https://apple.com` and then sent the OCSP query to Apple's real
responder. This makes the test flaky whenever the network is unreliable,
which regularly happens on GitHub runners.

Modification:

- Start a local Netty HTTP server on 127.0.0.1 that acts as OCSP
responder. It parses the OCSP request and answers with a signed `good`
response that echoes the nonce.
- Generate the CA and server certificate with `CertificateBuilder`, with
an OCSP URL that points to the local server.
- Enable nonce validation in the test.

Result:

`simpleOcspQueryTest` only talks to localhost and no longer depends on
external hosts.
@normanmaurer normanmaurer added this to the 4.2.20.Final milestone Oct 19, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Oct 19, 2026
@normanmaurer
Merge branch '4.2' into ocsp_test
31458a9
@testlens-app

testlens-app Bot commented Oct 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 17908

Build PR / macos-aarch64-java11-boringssl build > Netty/Transport/Native/KQueue

Test Runs Flakiness
KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo) ❌ 2% 🟡

🏷️ Commit: 31458a9
▶️ Tests: 39648 executed
⚪️ Checks: 27/27 completed

Test Failures

KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-aarch64-java11-boringssl build)
java.util.concurrent.TimeoutException: testAllDataReadClosure(org.junit.jupiter.api.TestInfo) timed out after 20000 milliseconds
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	Suppressed: java.lang.InterruptedException
		at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1040)
		at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
		at java.base/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:784)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:692)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest$16.run(SocketHalfClosedTest.java:684)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest$16.run(SocketHalfClosedTest.java:681)
		at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
		at io.netty.testsuite.transport.socket.SocketHalfClosedTest.testAllDataReadClosure(SocketHalfClosedTest.java:681)
		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
		... 2 more

Rerun Controls

Select tests to mute in this pull request:

  • KQueueETSocketHalfClosedTest > testAllDataReadClosure(TestInfo)

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer merged commit 28d5d02 into 4.2 Oct 19, 2026
27 of 28 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer deleted the ocsp_test branch October 19, 2026 12:36
@netty-project-bot

netty-project-bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 4.1.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@netty-project-bot

netty-project-bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Could not create auto-port PR.
Got conflicts when cherry-picking onto 5.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Oct 19, 2026
@normanmaurer

normanmaurer commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

Port for 5.0 #17920

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Oct 19, 2026
normanmaurer added a commit that referenced this pull request Oct 19, 2026
@normanmaurer
Don't use the network in OcspClientTest.simpleOcspQueryTest (#17908) (#…
3c6dc4d
…17920)

Motivation:

`OcspClientTest.simpleOcspQueryTest` fetched the certificate chain from
`https://apple.com` and then sent the OCSP query to Apple's real
responder. This makes the test flaky whenever the network is unreliable,
which regularly happens on GitHub runners.

Modification:

- Start a local Netty HTTP server on 127.0.0.1 that acts as OCSP
responder. It parses the OCSP request and answers with a signed `good`
response that echoes the nonce.
- Generate the CA and server certificate with `CertificateBuilder`, with
an OCSP URL that points to the local server.
- Enable nonce validation in the test.

Result:

`simpleOcspQueryTest` only talks to localhost and no longer depends on
external hosts.
normanmaurer added a commit that referenced this pull request Oct 23, 2026
@normanmaurer
Port 4.1: Don't use the network in the OCSP tests (#17908) (#17933)
4076ea5
Motivation:

`OcspClientTest.simpleOcspQueryTest` and
`OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest`
fetch the certificate chain from `https://apple.com` and then send the
OCSP query to Apple's real responder. This makes the tests flaky
whenever the network is unreliable, which regularly happens on GitHub
runners (for example with a `ConnectTimeoutException` to
`ocsp.apple.com:80` or a failed `assertTrue(ocspStatus.get())`).

Modification:

- Add `OcspTestUtil` with a local Netty HTTP server on 127.0.0.1 that
acts as OCSP responder. It parses the OCSP request and answers with a
signed `good` response that echoes the nonce. It also contains the
BouncyCastle helpers to generate the CA and server certificates with an
OCSP URL that points to the local server. 4.1 has no `pkitesting`
module, so `buildCertificate` accepts additional extensions.
- Use it in `OcspClientTest.simpleOcspQueryTest` and enable nonce
validation there.
- Use it in `OcspServerCertificateValidatorTest` together with a local
TLS server whose certificate points at the local OCSP responder.

Result:

Both tests only talk to localhost and no longer depend on external
hosts.
normanmaurer added a commit that referenced this pull request Oct 23, 2026
@normanmaurer
Port 4.1: Don't use the network in the OCSP tests (#17908) (#17933) (#…
1b11c85
…18038)

Motivation:

`OcspClientTest.simpleOcspQueryTest` and

`OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest`
fetch the certificate chain from `https://apple.com`/ and then send the
OCSP query to Apple's real responder. This makes the tests flaky
whenever the network is unreliable, which regularly happens on GitHub
runners (for example with a `ConnectTimeoutException` to
`ocsp.apple.com:80` or a failed `assertTrue(ocspStatus.get())`).

Modification:

- Add `OcspTestUtil` with a local Netty HTTP server on 127.0.0.1 that
acts as OCSP responder. It parses the OCSP request and answers with a
signed `good` response that echoes the nonce. It also contains the
BouncyCastle helpers to generate the CA and server certificates with an
OCSP URL that points to the local server. 4.1 has no `pkitesting`
module, so `buildCertificate` accepts additional extensions.
- Use it in `OcspClientTest.simpleOcspQueryTest` and enable nonce
validation there.
- Use it in `OcspServerCertificateValidatorTest` together with a local
TLS server whose certificate points at the local OCSP responder.

Result:

Both tests only talk to localhost and no longer depend on external
hosts.
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
@normanmaurer @lltopk
Port 4.1: Don't use the network in the OCSP tests (netty#17908) (nett…
c9cf549
…y#17933)  (netty#18038)

Motivation:

`OcspClientTest.simpleOcspQueryTest` and

`OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest`
fetch the certificate chain from `https://apple.com`/ and then send the
OCSP query to Apple's real responder. This makes the tests flaky
whenever the network is unreliable, which regularly happens on GitHub
runners (for example with a `ConnectTimeoutException` to
`ocsp.apple.com:80` or a failed `assertTrue(ocspStatus.get())`).

Modification:

- Add `OcspTestUtil` with a local Netty HTTP server on 127.0.0.1 that
acts as OCSP responder. It parses the OCSP request and answers with a
signed `good` response that echoes the nonce. It also contains the
BouncyCastle helpers to generate the CA and server certificates with an
OCSP URL that points to the local server. 4.1 has no `pkitesting`
module, so `buildCertificate` accepts additional extensions.
- Use it in `OcspClientTest.simpleOcspQueryTest` and enable nonce
validation there.
- Use it in `OcspServerCertificateValidatorTest` together with a local
TLS server whose certificate points at the local OCSP responder.

Result:

Both tests only talk to localhost and no longer depend on external
hosts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.20.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@normanmaurer @netty-project-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.