Skip to content

fix(test): usage_cmd fixtures used a fixed past date (time-bomb, fails all PRs today)#534

Merged
coseto6125 merged 1 commit into
mainfrom
fix/usage-test-timebomb
Jun 3, 2026
Merged

fix(test): usage_cmd fixtures used a fixed past date (time-bomb, fails all PRs today)#534
coseto6125 merged 1 commit into
mainfrom
fix/usage-test-timebomb

Conversation

@coseto6125
Copy link
Copy Markdown
Owner

Symptom

As of 2026-06-03, every PR's Test on {ubuntu,macos} fails on three usage_cmd tests (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 usage runs prune_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 the usage feature landed (#481) and detonated on schedule.

Fix

Generate fixture timestamps relative to now (now − 1h) via a recent_ts() helper, so they always sit inside the retention window. The deliberate usage_prunes_lines_older_than_retention test (fixed 2020/2099 dates) is untouched.

7/7 usage_cmd tests pass locally; clippy clean. Unblocks the 0.6.4 release PR (#533) and every other open PR.

…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.
@coseto6125 coseto6125 enabled auto-merge (squash) June 3, 2026 08:03
@coseto6125 coseto6125 added the merge-queue Opt-in to Mergify merge queue label Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

ecp impact cache (0 symbols) — internal, used by ecp dev pr-analyze

[]

@github-actions github-actions Bot added the ecp:risk-low ecp signal label Jun 3, 2026
@coseto6125 coseto6125 merged commit 264802c into main Jun 3, 2026
18 checks passed
@coseto6125 coseto6125 deleted the fix/usage-test-timebomb branch June 3, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecp:risk-low ecp signal merge-queue Opt-in to Mergify merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant