fix(test): usage_cmd fixtures used a fixed past date (time-bomb, fails all PRs today)#534
Merged
Merged
Conversation
…e-bomb) The three usage aggregation tests hard-coded `ts:2026-05-27`. `ecp usage` prunes telemetry lines older than the default 7-day retention BEFORE aggregating, so once that date aged past the window (today, 2026-06-03) every fixture line was pruned → total:0 → assertions failed on every PR, unrelated to its diff. Generate the fixture timestamps relative to now (now − 1h) via a `recent_ts()` helper so they always sit inside the retention window. The intentional `usage_prunes_lines_older_than_retention` test (fixed 2020/2099 dates) is left as-is. 7/7 usage_cmd tests pass; clippy clean.
Contributor
ecp impact cache (0 symbols) — internal, used by
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
As of 2026-06-03, every PR's
Test on {ubuntu,macos}fails on threeusage_cmdtests (usage_json_aggregates_a_fixture,usage_text_dashboard_is_plain_when_piped,usage_failures_lists_only_errors) —total:0/assertion failed: s.contains("inspect"). The failure is unrelated to any PR's diff (reproduced on a docs-only branch).Root cause — a time-bomb
The fixtures hard-code
"ts":"2026-05-27T...".ecp usagerunsprune_retention(drops lines older than the default 7-day retention) BEFORE aggregating. Today is exactly 7 days past 2026-05-27, so all fixture lines are pruned → empty aggregate → assertions fail. This was latent since theusagefeature landed (#481) and detonated on schedule.Fix
Generate fixture timestamps relative to now (
now − 1h) via arecent_ts()helper, so they always sit inside the retention window. The deliberateusage_prunes_lines_older_than_retentiontest (fixed 2020/2099 dates) is untouched.7/7
usage_cmdtests pass locally; clippy clean. Unblocks the 0.6.4 release PR (#533) and every other open PR.