Skip to content

test: the peer cache in the stale-disk warm test carries the peer token - #765

Merged
szibis merged 1 commit into
mainfrom
test/peer-warm-token
Oct 17, 2026
Merged

szibis merged 1 commit into
mainfrom
test/peer-warm-token

Conversation

@szibis

@szibis szibis commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

TestLabelSurface_LabelValuesIndexStartupWarmsFromPeersWhenDiskStale failed once in release validation with unexpected peer token header: got "".

The test gives the proxy PeerAuthToken: "shared-secret" but builds the peer cache without AuthToken. Requests the proxy sends itself carry the token. Requests the peer cache sends on its own (a get or push for a key that the fake peer owns on the hash ring) did not. Ownership depends on the random httptest port, so the test failed only sometimes.

cmd/proxy sets the same token on both (cache.PeerConfig.AuthToken: cfg.peerAuthToken). The test now does the same. Test-only change; no behaviour change.

Test plan

  • go test -short -p 1 -race -count=50 -run TestLabelSurface_LabelValuesIndexStartupWarms ./internal/proxy/ passes

…en, as the proxy configures it

The test gave the proxy a peer token but built its peer cache without one. Any request the peer cache sent itself (a get or push for a key the fake peer owns on the hash ring, which depends on the random test port) reached the fake peer with no token and failed the test. cmd/proxy sets the same token on both, so the test now does too.
@github-actions github-actions Bot added size/XS Extra small change scope/proxy Proxy core scope/tests Tests labels Oct 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Quality Report

Compared against base branch main.

Coverage and tests

Signal Base PR Delta
Test count 10738 10738 0
Coverage 88.0% 88.0% 0.0% (stable)

Compatibility

Track Base PR Delta
Loki API 100.0% 11/11 (100.0%) 0.0% (stable)
Logs Drilldown 100.0% 17/17 (100.0%) 0.0% (stable)
VictoriaLogs 100.0% 11/11 (100.0%) 0.0% (stable)

Performance smoke

Lower CPU cost (ns/op) is better. Lower benchmark memory cost (B/op, allocs/op) is better. Higher throughput is better. Lower load-test memory growth is better. Benchmark rows are medians from repeated samples.

Signal Base PR Delta
QueryRange cache-hit CPU cost 2537.0 ns/op 2533.0 ns/op -0.2% (stable)
QueryRange cache-hit memory 1240.0 B/op 1240.0 B/op 0.0% (stable)
QueryRange cache-hit allocations 27.0 allocs/op 27.0 allocs/op 0.0% (stable)
QueryRange cache-bypass CPU cost 2979.0 ns/op 2976.0 ns/op -0.1% (stable)
QueryRange cache-bypass memory 1289.0 B/op 1289.0 B/op 0.0% (stable)
QueryRange cache-bypass allocations 27.0 allocs/op 27.0 allocs/op 0.0% (stable)
Labels cache-hit CPU cost 671.1 ns/op 671.7 ns/op +0.1% (stable)
Labels cache-hit memory 48.0 B/op 48.0 B/op 0.0% (stable)
Labels cache-hit allocations 3.0 allocs/op 3.0 allocs/op 0.0% (stable)
Labels cache-bypass CPU cost 1113.0 ns/op 1095.0 ns/op -1.6% (stable)
Labels cache-bypass memory 397.0 B/op 397.0 B/op 0.0% (stable)
Labels cache-bypass allocations 14.0 allocs/op 14.0 allocs/op 0.0% (stable)

State

  • Coverage, compatibility, and sampled performance are reported here from the same PR workflow.
  • This is a delta report, not a release gate by itself. Required checks still decide merge safety.
  • Performance is a smoke comparison, not a full benchmark lab run.
  • Delta states use the same noise guards as the quality gate (percent + absolute + low-baseline checks), so report labels match merge-gate behavior.

@szibis
szibis merged commit cd174a7 into main Oct 17, 2026
62 checks passed
@szibis
szibis deleted the test/peer-warm-token branch October 17, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/proxy Proxy core scope/tests Tests size/XS Extra small change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant