Skip to content

test/e2e: wait for diagnostic listeners before running tests - #9134

Open
sspaink wants to merge 1 commit into
open-policy-agent:mainfrom
sspaink:e2e-diagnostic-listener-race
Open

test/e2e: wait for diagnostic listeners before running tests#9134
sspaink wants to merge 1 commit into
open-policy-agent:mainfrom
sspaink:e2e-diagnostic-listener-race

Conversation

@sspaink

@sspaink sspaink commented Sep 1, 2026

Copy link
Copy Markdown
Member

Listeners bind on their own goroutines and the runtime reports itself initialized without waiting for them, so WaitForServer could return while Runtime.DiagnosticAddrs() was still empty and panic the diagnostics tests.

TestServerWithDiagnosticAddrHealthCheck panicked on the Go Race Detector job for PR 9124: https://github.com/open-policy-agent/opa/actions/runs/33528247114/job/99926014485

--- FAIL: TestServerWithDiagnosticAddrHealthCheck (0.00s)
panic: runtime error: index out of range [0] with length 0 [recovered, repanicked]
...
github.com/open-policy-agent/opa/v1/test/e2e/diagnostics.diagURL(0xc0006b4488)
    /src/v1/test/e2e/diagnostics/diagnostics_test.go:80 +0x192
github.com/open-policy-agent/opa/v1/test/e2e/diagnostics.TestServerWithDiagnosticAddrHealthCheck(0xc0006b4488)
    /src/v1/test/e2e/diagnostics/diagnostics_test.go:31 +0x2f
FAIL  github.com/open-policy-agent/opa/v1/test/e2e/diagnostics

Listeners bind on their own goroutines and the runtime reports itself
initialized without waiting for them, so WaitForServer could return while
Runtime.DiagnosticAddrs() was still empty and panic the diagnostics tests.

Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
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