Skip to content

Conversation

@vkarpov15
Copy link
Member

Motivation

  • Add coverage for behavior when an in-progress task times out but has a non-zero retryOnTimeoutCount so a retry task is created.
  • Ensure the retry copy resets runtime-specific fields and decrements the retry counter.

Description

  • Add a new unit test in test/task.test.js named creates a retry task when a timed out task has retryOnTimeoutCount that simulates an expired in_progress task and calls Task.expireTimedOutTasks().
  • Assert the original task moves to timed_out and that a new pending retry task is created with retryOnTimeoutCount decremented.
  • Assert the retry task has runtime fields cleared (startedRunningAt, finishedRunningAt, workerName, timeoutAt, error, result) and retains the original scheduledAt and params.
  • Assert the retry task's schedulingTimeoutAt is set to now.valueOf() + 10 * 60 * 1000 as expected by the expiry logic.

Testing

  • No automated tests were executed as part of this change.
  • The change only adds unit test coverage in test/task.test.js and commits it to the branch.

Codex Task

Copilot AI review requested due to automatic review settings January 2, 2026 21:40
Copy link
Contributor

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

This PR adds test coverage for the retry mechanism when an in-progress task times out and has a non-zero retryOnTimeoutCount value. The test ensures that the expired task transitions to timed_out status and a new retry task is created with proper field resets and counter decrementation.

Key changes:

  • Adds new test case creates a retry task when a timed out task has retryOnTimeoutCount in test/task.test.js
  • Verifies retry task creation with decremented retryOnTimeoutCount (from 2 to 1)
  • Validates runtime fields are cleared and scheduling fields are properly set

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vkarpov15 vkarpov15 merged commit 2696305 into main Jan 2, 2026
4 checks passed
@vkarpov15 vkarpov15 deleted the codex/add-test-cases-for-timeout-retry-task branch January 2, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants