Skip to content

test(server): node-path regressions race asynchronous index readiness #2083

Description

@n30nex

Several node-path regression tests call store.Load() and immediately request /api/nodes/:key/paths. Index construction runs asynchronously, so the handler can correctly return HTTP 503 {"error":"index loading","retryAfter":5} before the test reaches the behavior it intends to check.

Reproduced on unchanged 9eb3098 with native Go 1.25.1 and cgo:

cd cmd/server
GOMAXPROCS=4 go test -p 2 -run '^TestHandleNodePaths_' -count 10 .

Failures varied across runs and included canonical hop names (#1144), recency/count sorting (#1145), prefix-collision fallback (#1352), and prefix-collision exclusion. A full server test run also hit the same 503 assertion failures.

Affected setup lives in paths_hop_name_test.go, paths_sort_test.go, paths_through_collision_1352_test.go, paths_through_test.go, and potentially other path tests using the same immediate-load pattern.

Expected: these behavior tests wait for index readiness through the existing bounded WaitIndexesReady API before issuing requests. Preserve their existing response assertions; do not add arbitrary sleeps, retries that hide the 503, or change the production readiness gate. Validate the complete server suite and repeated targeted tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions