Skip to content

Flaky LDAP connector tests: embedded OpenDJ misses the 5 s shutdown budget in waitUntilStopped() #111

Description

@vharseko

Seen in https://github.com/OpenIdentityPlatform/OpenICF/actions/runs/29743183432/job/88354582201 (PR #110, build-maven (ubuntu-latest, 11) — the PR touches only the WebSocket framework, not this module; the other 9 matrix jobs passed).

Symptom

[ERROR] org.identityconnectors.ldap.modify.LdapDeleteTests.before -- Time elapsed: 17.38 s <<< FAILURE!
java.io.IOException: OpenDJ failed to stop after applying test-config.ldif
	at org.identityconnectors.ldap.LdapConnectorTestBase.startAndApply(LdapConnectorTestBase.java:448)
	at org.identityconnectors.ldap.LdapConnectorTestBase.createInstance(LdapConnectorTestBase.java:357)
	at org.identityconnectors.ldap.LdapConnectorTestBase.startServer(LdapConnectorTestBase.java:249)
	at org.identityconnectors.ldap.LdapConnectorTestBase.before(LdapConnectorTestBase.java:171)

Surefire reruns of the same test passed (Run 1: FAIL, Run 2: PASS, Run 3: PASS), but a failure in a configuration method is not forgiven as flaky, so the module fails the build and cascade-skips the remaining tests (309 skipped in that run).

Root cause

LdapConnectorTestBase.waitUntilStopped() (embedded OpenDJ harness introduced in #101) gives the server at most 25 × 200 ms = 5 s to stop:

private static boolean waitUntilStopped() {
    final int WAIT = 200; // ms
    final int ITERATIONS = 25;
    for (int i = 1; EmbeddedUtils.isRunning() || isAnyPortStillBound(); i++) {
        if (i >= ITERATIONS) {
            return false;
        }
        ...

On a loaded CI runner the OpenDJ shutdown after applying test-config.ldif can exceed 5 s (the whole before took 17.4 s in the failing run), so startAndApply throws.

Proposal

Raise the shutdown budget (e.g. 5 s → 30 s, ITERATIONS 25 → 150). The loop exits as soon as the server is actually down, so the change costs nothing in the successful case and only widens the margin on slow runners. The same budget in stopServer's waitUntilStopped() call site (line ~282) is covered by the same constant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI, build & workflow changesconnector:ldapLDAP connectortestsTest additions or fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions