Fix flaky BindOperationTestCase subtree auth-info tests#727
Open
vharseko wants to merge 1 commit into
Open
Conversation
testSubtreeDeleteClearsAuthInfo and testSubtreeModifyUpdatesAuthInfo asserted the AuthenticatedUsers registry state immediately after the LDAPDelete / LDAPModify tool returned. The registry is updated by a POST_RESPONSE plugin, i.e. after the client already received the operation response, so on a loaded machine the assertion can run before the plugin: the delete variant still saw the stale connection mapping, the modDN variant did not yet see the re-keyed DN. Failed on 2 of 5 ubuntu legs in recent CI runs (PR OpenIdentityPlatform#714, OpenIdentityPlatform#725). Poll the assertions with TestTimer (10s max, 100ms steps) instead, following the same pattern used for similar post-response races elsewhere in the suite.
maximthomas
approved these changes
Jul 10, 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.
Problem
BindOperationTestCase.testSubtreeDeleteClearsAuthInfoandtestSubtreeModifyUpdatesAuthInfofail intermittently on CI, with risingfrequency — 2 of 5 ubuntu legs on each of the two most recent runs (PR #714,
PR #725), always one of:
Root cause
Both tests assert the
DirectoryServer.getAuthenticatedUsers()registry stateimmediately after the
LDAPDelete/LDAPModifytool returns success. Theregistry is maintained by
AuthenticatedUsers, anInternalDirectoryServerPluginregistered at the POST_RESPONSEmodify/modifyDN/delete plugin points — by definition it runs after the
response has been sent to the client. On a loaded CI machine the assertion can
therefore observe the registry before the plugin has run: the subtree-delete
variant still sees the stale connection mapping
(
userMap.removeSubtree()not yet executed), the modDN variant does not yetsee the re-keyed DN.
The sibling
testRebindClearsAuthInfoin the same file already guards againstoperation asynchronicity explicitly (
TestCaseUtils.quiesceServer()); the twosubtree tests had no such guard.
Fix
Poll the post-operation assertions with
TestTimer(10 s max, 100 ms steps) —the same pattern used for similar post-response/asynchronous races elsewhere
in the suite (e.g.
TasksTestCase, the #686 series). Bounded polling assertsexactly the intended contract ("the registry converges shortly after the
response") without depending on work-queue idle semantics, and on a real
regression still fails with the original assertion error.
Test-only change; no product code touched.
Tests
mvn -P precommit -pl opendj-server-legacy verifyfortestSubtreeDeleteClearsAuthInfo,testSubtreeModifyUpdatesAuthInfo,testRebindClearsAuthInfo(reruns disabled): 3/3, 0 failures.