test: add RetryableTask regression coverage#289
Open
YunchuWang wants to merge 1 commit into
Open
Conversation
…-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>
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #219