Skip to content

fix: use week-relative dates in retention chart test#184

Merged
ManukMinasyan merged 1 commit intomainfrom
fix/main-ci-failure
Mar 17, 2026
Merged

fix: use week-relative dates in retention chart test#184
ManukMinasyan merged 1 commit intomainfrom
fix/main-ci-failure

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

@ManukMinasyan ManukMinasyan commented Mar 17, 2026

Summary

  • The UserRetentionChartWidgetTest was flaky because it used now()->subDays(2) and now()->subDays(1) for test data, which can cross a weekly interval boundary depending on which day of the week the test runs (e.g., Sunday vs Monday when Carbon weeks start on Monday).
  • Fixed by anchoring test dates to now()->startOfWeek(), ensuring the "new active" user and their activity always fall within the same weekly interval regardless of which day the test runs.

Test plan

  • Reproduced the failure locally (today is Tuesday, subDays(2) = Sunday, different week)
  • Verified both tests in UserRetentionChartWidgetTest pass after the fix
  • CI pipeline passes on this branch

Copilot AI review requested due to automatic review settings March 17, 2026 18:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Stabilizes the UserRetentionChartWidgetTest by anchoring the “new active” user signup and activity timestamps to the start of the current week, preventing week-boundary-dependent misclassification.

Changes:

  • Anchor test timestamps to now()->startOfWeek() to ensure user signup and activity fall in the same weekly interval.
  • Replace relative subDays() timestamps for the “new active” user and related company creation with week-relative timestamps.

@ManukMinasyan ManukMinasyan merged commit 04061dd into main Mar 17, 2026
10 checks passed
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.

2 participants