Skip to content

fix(page): restore test timeout after page.pause() in headless mode#40401

Open
abhi41289 wants to merge 2 commits intomicrosoft:mainfrom
abhi41289:fix-38754
Open

fix(page): restore test timeout after page.pause() in headless mode#40401
abhi41289 wants to merge 2 commits intomicrosoft:mainfrom
abhi41289:fix-38754

Conversation

@abhi41289
Copy link
Copy Markdown

Summary

  • page.pause() calls onWillPause() which increments the ignore-timeouts counter, but never decremented it
  • In headed/inspector mode this is intentional — timeouts stay off during the debug session
  • In headless mode, channel.pause() resolves immediately (no inspector to handle it), leaving the counter permanently elevated and disabling the test timeout for the rest of the test
  • Add onDidResume() to ClientInstrumentation, called after channel.pause() resolves, so the counter is always balanced

Fixes #38754

abhi41289 and others added 2 commits April 24, 2026 17:30
When the same @tag appears in both a describe title and a test title
(or in nested describe blocks), test.tags returned it multiple times.
Wrap the result in Set to deduplicate.

Fixes microsoft#40368
page.pause() called onWillPause() which incremented the ignore-timeouts
counter, but never decremented it. In headed/inspector mode this was
intentional (timeouts stay off for the debug session). In headless mode
the pause resolves immediately with no inspector, leaving the counter
permanently elevated and disabling the test timeout for the rest of the
test run.

Add onDidResume() to ClientInstrumentation, called after channel.pause()
resolves, so the counter is balanced regardless of mode.

Fixes microsoft#38754
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.

[Bug]: page.pause() disables test timeout in headless mode, causing Playwright to hang

1 participant