Skip to content

fix(pause): ignore step failures inside tryTo and retryTo - #5741

Merged
DavertMik merged 1 commit into
4.xfrom
fix/pause-skip-effect-failures
Oct 7, 2026
Merged

DavertMik merged 1 commit into
4.xfrom
fix/pause-skip-effect-failures

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

Fixes #4516. Alternative to #5736.

With -p pause (on=fail), a step that failed inside tryTo or retryTo paused the test even when the test passed.

Instead of switching the trigger to test.failed, the effects now track whether they are active:

  • lib/effects.js keeps an activeEffects counter and exports isEffectActive(). tryTo counts for its whole run; retryTo counts only attempts that will be retried, so a failure on the last attempt still pauses. The counter resets on test.before.
  • lib/plugin/pause.js ignores step.failed while isEffectActive() is true.
Case Before After
step fails inside tryTo pause no pause
retryTo passes on a later attempt pause no pause
retryTo uses up all attempts pause pause
hopeThat soft assertion fails pause pause
real failing step / failing Before or After pause pause
plain throw without a failed step no pause no pause

Tests: test/unit/plugin/pause_test.js (based on the one from #5736) covers these cases.

Known unrelated issue: a step failing inside within inside tryTo gets past tryTo and fails the test; this happens on 4.x without this change.

🤖 Generated with Claude Code

Effects track how many are active; pause on=fail skips step failures
while tryTo or a retryTo attempt that will be retried is running.

Fixes #4516

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavertMik
DavertMik merged commit def64e2 into 4.x Oct 7, 2026
14 checks passed
@DavertMik
DavertMik deleted the fix/pause-skip-effect-failures branch October 7, 2026 22:28
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.

tryTo() triggering false positive to pauseOnFail - stopping at first scenario

1 participant