Skip to content

test: add RetryableTask regression coverage#289

Open
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/test/retryable-task-missing-coverage
Open

test: add RetryableTask regression coverage#289
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/test/retryable-task-missing-coverage

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

Summary

Fixes #219

…-timeout, and complete() override

Add three new test cases to retryable-task.spec.ts covering previously untested
code paths:

1. Non-retriable failure guard (computeNextDelayInMilliseconds line 63-65):
   Verifies that failures marked isNonRetriable=true immediately return
   undefined, preventing retries of fundamentally broken operations like
   unregistered activities.

2. Delay-exceeds-remaining-timeout guard (lines 106-113): Verifies that
   when elapsed time is within the timeout but the computed retry delay
   would overshoot the remaining window, no retry is scheduled. This is
   distinct from the existing elapsed-timeout test which checks lines 86-91.

3. complete() override from RetryTaskBase (lines 129-136): Verifies that
   successful retry completion clears _exception and _lastFailure, ensuring
   stale failure state does not leak into the completed task.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 7, 2026 21:56

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.

Pull request overview

Adds regression test coverage for RetryableTask’s retry-delay computation and state-reset behaviors to prevent future regressions in key guard paths described in issue #219.

Changes:

  • Adds a test ensuring non-retriable failures (isNonRetriable=true) stop retries immediately.
  • Adds a test ensuring a computed retry delay that would overshoot the remaining retry timeout returns undefined.
  • Adds a test verifying complete() clears prior failure state (lastFailure) on success.

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.

[copilot-finds] Test: RetryableTask missing coverage for non-retriable failures, remaining-timeout guard, and complete() override

3 participants