Skip to content

Fix Schedule.cron with infinite TestClock adjustment#6295

Open
LevDomasnih wants to merge 2 commits into
Effect-TS:mainfrom
LevDomasnih:fix/cron-testclock-infinity
Open

Fix Schedule.cron with infinite TestClock adjustment#6295
LevDomasnih wants to merge 2 commits into
Effect-TS:mainfrom
LevDomasnih:fix/cron-testclock-infinity

Conversation

@LevDomasnih

Copy link
Copy Markdown

Fixes #6292.

Schedule.cron previously attempted to evaluate the next cron date even when the current clock time was non-finite. This can happen in tests when TestClock.adjust(Infinity) advances the test clock while a repeated effect is still suspended.

This adds a guard for non-finite now values in the cron schedule step and includes a regression test covering Cron + TestClock.adjust(Infinity).

Verification:

  • Reproduced the original IllegalArgumentException: Invalid date locally before the fix
  • Verified the repro completes after the fix
  • pnpm --filter effect check

@LevDomasnih LevDomasnih requested a review from mikearnaldi as a code owner June 28, 2026 11:30
@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jun 28, 2026
@changeset-bot

changeset-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d780aa5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
effect Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

Cron + TestClock.adjust(Infinity) results in invalid date crash

1 participant