Skip to content

discovery/consul: run tests in parallel - #18611

Merged
krajorama merged 1 commit into
prometheus:mainfrom
ogulcanaydogan:chore/consul-parallel-tests
May 19, 2026
Merged

krajorama merged 1 commit into
prometheus:mainfrom
ogulcanaydogan:chore/consul-parallel-tests

Conversation

@ogulcanaydogan

Copy link
Copy Markdown
Contributor

Refs #15185

All 13 top-level test functions in discovery/consul/consul_test.go create
their own httptest.Server and prometheus.Registry, so there is no shared
global state between them. Adding t.Parallel() to each top-level test and
to the four subtests inside TestUnmarshalConfig allows the Go test runner
to overlap them.

No existing PR covers this package (confirmed with gh pr list --search "discovery/consul").

Testing: go test -race -count=1 ./discovery/consul/... — pass.

NONE

@ogulcanaydogan
ogulcanaydogan requested review from a team and mrvarmazyar as code owners April 30, 2026 14:22
@ogulcanaydogan
ogulcanaydogan requested a review from brancz April 30, 2026 14:22
@ogulcanaydogan ogulcanaydogan mentioned this pull request May 1, 2026
10 of 17 tasks
Each test creates its own httptest.Server and prometheus.Registry so
there is no shared global state between them. Adding t.Parallel() to
all 13 top-level test functions and the subtests in TestUnmarshalConfig
allows the Go test runner to overlap them, cutting wall-clock time.

Refs: prometheus#15185
Signed-off-by: Ogulcan Aydogan <[email protected]>
@ogulcanaydogan
ogulcanaydogan force-pushed the chore/consul-parallel-tests branch from 677bf53 to fce1ba0 Compare May 6, 2026 14:13
@krajorama
krajorama merged commit e01be38 into prometheus:main May 19, 2026
35 checks passed
@krajorama

Copy link
Copy Markdown
Member

Hello from the bug scrub!

Merged based on code owner review.

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.

3 participants