Skip to content

fix: [proxy/engines] dpc chunk test wallclock dependency#1013

Closed
crandles wants to merge 3 commits into
trickstercache:mainfrom
crandles:fix-dpc-chunk-test-timebomb
Closed

fix: [proxy/engines] dpc chunk test wallclock dependency#1013
crandles wants to merge 3 commits into
trickstercache:mainfrom
crandles:fix-dpc-chunk-test-timebomb

Conversation

@crandles
Copy link
Copy Markdown
Contributor

@crandles crandles commented May 27, 2026

Description

Three chunk tests in pkg/proxy/engines/deltaproxycache_chunk_test.go hardcode now := time.Date(2026, 4, ...) and fail once real wallclock moves past step * TimeseriesRetention (1h * 1024 = ~42.67d) beyond the fixture date. TestDeltaProxyCacheRequestRangeMissChunks started failing locally around 2026-05-25, the two _CrossBucket siblings would have followed a few days later.

The trigger is the EvictionMethodOldest branch in deltaproxycache.go:238-251 -- OldestRetainedTimestamp is computed from time.Now(), so a fixed-calendar trq.Extent.End eventually slides before it and DPC short-circuits to DoProxy (engine=HTTPProxy, status=proxy-only). The fixture comment about the "17.5d chunk bucket" was about a different thing (chunk size = step * DefaultTimeseriesChunkFactor); it isn't what was tripping the test.

First commit is intentionally empty so CI captures the failure on a clean branch off main, leaving a permanent record of the time bomb. Second commit replaces the hardcoded dates with two helpers anchored to time.Now():

  • chunkBucketAnchor(step) for the single-bucket case (TestDeltaProxyCacheRequestRangeMissChunks) -- midpoint of a recently-completed chunk bucket
  • chunkBucketStraddle(step) for the cross-bucket cases -- 11h after a recent chunk-bucket boundary so Q1 (-30h..-12h) and Q2 (-10h..-8h) fall on opposite sides

Both helpers stay well inside the retention window so future wallclock drift can't reintroduce the same failure.

Type of Change

    • Bug fix

AI Disclosure

    • This contribution DOES include AI-generated changes, and I have reviewed the relevant contributing guidelines.

crandles added 3 commits May 27, 2026 10:37
Signed-off-by: Chris Randles <randles.chris@gmail.com>
Signed-off-by: Chris Randles <randles.chris@gmail.com>
…lclock gate

Signed-off-by: Chris Randles <randles.chris@gmail.com>
@crandles
Copy link
Copy Markdown
Contributor Author

merged to #1012

@crandles crandles closed this May 27, 2026
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