Skip to content

test: make retrospective timing deterministic - #1945

Merged
1 commit merged into
devfrom
squad/fix-retro-time-dependent-test
Sep 2, 2026
Merged

1 commit merged into
devfrom
squad/fix-retro-time-dependent-test

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

Summary

  • Freeze RetroCapability tests at a known non-Friday instant.
  • Restore real timers after the scoped tests.
  • Add explicit coverage that Friday after 14:00 UTC still forces a retrospective.

Why

The tests derived their fixture date from the real clock while expecting retro not due. Production intentionally forces a retrospective every Friday after 14:00 UTC, so unrelated PRs failed during that weekly window.

Validation

  • SKIP_BUILD_BUMP=1 npm run build
  • npm exec -- vitest run test/cli/watch-capabilities.test.ts -t RetroCapability

Closes #1944

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 28, 2026 19:31
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 4dc69b5

PR Scope: 🔧 Infrastructure

⚠️ 1 item(s) to address before review

Status Check Details
✅ Single commit 1 commit — clean history
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present No source files changed — changeset not required
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved No Copilot review threads
✅ CI passing All checks passing

Files Changed (1 file, +22 −1)

File +/−
test/cli/watch-capabilities.test.ts +22 −1

Total: +22 −1


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 Impact Analysis — PR #1945

Risk tier: 🟢 LOW

📊 Summary

Metric Count
Files changed 1
Files added 0
Files modified 1
Files deleted 0
Modules touched 1

🎯 Risk Factors

  • 1 files changed (≤5 → LOW)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

tests (1 file)
  • test/cli/watch-capabilities.test.ts

This report is generated automatically for every PR. See #733 for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes are isolated to tests, correctly scope/restore fake timers, and add deterministic coverage for the intended Friday-afternoon behavior.

Review tier: Lite
Findings: None

What changed in this PR

This PR makes RetroCapability tests deterministic by freezing time to a known non-Friday instant, ensuring they no longer fail during the intentional “Friday after 14:00 UTC” retrospective window, and adds an explicit regression test for that Friday-afternoon behavior.

Changes:

  • Freeze timers/system time for the RetroCapability test scope and restore real timers after each test.
  • Add a test asserting that Friday after 14:00 UTC forces a retrospective even if one exists for the same day.
File Description
test/​cli/​watch-capabilities.test.ts Uses fake timers + fixed system time for deterministic RetroCapability tests and adds explicit Friday-after-14:00 UTC coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

tamirdresher pushed a commit that referenced this pull request Aug 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher tamirdresher closed this pull request by merging all changes into dev in 5ee4688 Sep 2, 2026
@bradygaster
bradygaster deleted the squad/fix-retro-time-dependent-test branch September 9, 2026 19:44
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.

Fix Friday-dependent retrospective tests

2 participants