Conversation
hyp3rd
commented
Apr 10, 2026
- Change test baseTime from Jan 1 to Jun 3 to prevent januaryFirstOffsetSpec from firing unexpectedly (negative WaitGroup)
- Handle missing go.sum in tidy-check CI steps (no dependencies)
- Increase chain_test timing constants for race-detector stability
- Change test baseTime from Jan 1 to Jun 3 to prevent januaryFirstOffsetSpec from firing unexpectedly (negative WaitGroup) - Handle missing go.sum in tidy-check CI steps (no dependencies) - Increase chain_test timing constants for race-detector stability Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Addresses CI instability introduced around the v4 launch by making fake-clock tests less date-sensitive, improving go mod tidy checks when no go.sum is present, and relaxing timing constants to reduce race-detector flakiness.
Changes:
- Move fake-clock
baseTimefrom Jan 1 to Jun 3 to avoid month-specific cron specs firing unexpectedly in tests. - Update CI “tidy check” steps to not hard-fail when
go.sumdoesn’t exist. - Increase timing constants in chain-related tests to improve stability under the race detector.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cron_test.go |
Adjusts fixed fake-clock anchor date and updates related test comment to avoid month-specific spec interactions. |
chain_test.go |
Increases sleep/duration constants to reduce timing flakiness (esp. with -race). |
.github/workflows/lint.yml |
Tweaks tidy-check diffing to handle absence of go.sum. |
.github/workflows/go.yml |
Mirrors tidy-check adjustment in the main Go workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| go mod tidy | ||
| git diff --exit-code go.mod go.sum | ||
| git diff --exit-code go.mod | ||
| test ! -f go.sum || git diff --exit-code go.sum |
There was a problem hiding this comment.
The test ! -f go.sum || ... guard will skip the diff check when go mod tidy removes a previously-tracked go.sum (file no longer exists), so CI could pass even though the deletion wasn’t committed. Consider guarding on whether go.sum is tracked (e.g., via git ls-files --error-unmatch go.sum) and then always running git diff --exit-code -- go.sum to catch modifications and deletions, while still supporting repos that don’t track go.sum.
| test ! -f go.sum || git diff --exit-code go.sum | |
| if git ls-files --error-unmatch go.sum >/dev/null 2>&1; then | |
| git diff --exit-code -- go.sum | |
| fi |
| go mod tidy | ||
| git diff --exit-code go.mod go.sum | ||
| git diff --exit-code go.mod | ||
| test ! -f go.sum || git diff --exit-code go.sum |
There was a problem hiding this comment.
Same issue as in lint.yml: checking file existence will miss the case where a tracked go.sum gets deleted by go mod tidy (since the file won’t exist and the diff check is skipped). Prefer checking whether go.sum is tracked, then diff it (which will report deletions), while skipping entirely when it’s not tracked in the repo.
| test ! -f go.sum || git diff --exit-code go.sum | |
| if git ls-files --error-unmatch go.sum >/dev/null 2>&1; then | |
| git diff --exit-code go.sum | |
| fi |