[#748] stabilize flaky GrizzlyLDAPConnectionFactoryTestCase.testResourceManagement#749
Merged
vharseko merged 1 commit intoJul 18, 2026
Conversation
…FactoryTestCase.testResourceManagement The async connection-error notification path is correct for every event ordering, so the intermittent timeout on the macOS/Java 11 CI runner was delivery latency, not a lost notification: one of the 100 iterations exceeded the 30s deadline under load. Raise the shared TEST_TIMEOUT from 30s to 60s so a slow runner no longer produces false-negative builds; ITERATIONS stays at 100 to preserve the OPENDJ-1156 race coverage.
maximthomas
approved these changes
Jul 18, 2026
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.
Fixes #748.
Problem
GrizzlyLDAPConnectionFactoryTestCase.testResourceManagement(regression test for OPENDJ-1156) intermittently times out on themacos-latest, 11CI matrix job, breaking otherwise-green builds. The test runs 100 iterations, each opening a connection, triggering a remotedisconnect(), and waiting up toTEST_TIMEOUT = 30sfor the client-side error notification (listener.awaitError(...)).Root cause
This is delivery latency, not a lost notification. The async connection-error path is correct for every event ordering:
CompletionHandlerAdapter.completed()registersLDAP_CONNECTION_ATTR(viaregisterConnection) before the connection promise is fulfilled, so by the timegetConnection()returns anddisconnect()is called, the client connection is fully registered andLDAPClientFilter.handleClose()finds a non-nullldapConnection→GrizzlyLDAPConnection.close()fireshandleConnectionError.addConnectionEventListener()notifies it immediately via theisFailedbranch.Both orderings deliver exactly one notification, so no product code is at fault. On a slow/loaded macOS + Java 11 runner one of the 100 iterations simply exceeded the 30s deadline (elapsed time was 30.08s). 8 of 9 matrix jobs passed — an environment symptom, not a functional regression.
Fix
Raise the shared
TEST_TIMEOUTfrom 30s to 60s. It is a generous upper bound, not an expected duration — in the normal case the awaited latch releases within milliseconds, so this only takes effect under runner slowness and trades a slower failure for far fewer false-negative builds.ITERATIONSstays at 100 to preserve the OPENDJ-1156 race coverage. No product code changed.Verification
mvn -pl opendj-grizzly surefire:test -Dtest='GrizzlyLDAPConnectionFactoryTestCase#testResourceManagement'→ all tests passed.