Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: page.pause() timeout reset #2157

Merged
merged 1 commit into from
Nov 13, 2023
Merged

Conversation

mxschmitt
Copy link
Member

Fixes #2154

@@ -248,15 +248,18 @@ def set_default_navigation_timeout(self, timeout: float) -> None:
def _set_default_navigation_timeout_impl(self, timeout: Optional[float]) -> None:
self._timeout_settings.set_default_navigation_timeout(timeout)
self._channel.send_no_reply(
"setDefaultNavigationTimeoutNoReply", dict(timeout=timeout)
"setDefaultNavigationTimeoutNoReply",
{} if timeout is None else {"timeout": timeout},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was that on protocol level we don't allow timeout to be null.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider serializing None as undefined or too many things break?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many things would break I believe!

@mxschmitt mxschmitt force-pushed the fix-page-pause-timeout-reset branch from 432dbeb to d1bd87c Compare November 13, 2023 11:57

await page.goto(server.EMPTY_PAGE)
page.pause()
with pytest.raises(Error, match="Timeout 30000ms exceeded."):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to slow down all tests by 30s?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no other option instead of hacking around the impl for testing.

@@ -248,15 +248,18 @@ def set_default_navigation_timeout(self, timeout: float) -> None:
def _set_default_navigation_timeout_impl(self, timeout: Optional[float]) -> None:
self._timeout_settings.set_default_navigation_timeout(timeout)
self._channel.send_no_reply(
"setDefaultNavigationTimeoutNoReply", dict(timeout=timeout)
"setDefaultNavigationTimeoutNoReply",
{} if timeout is None else {"timeout": timeout},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider serializing None as undefined or too many things break?

@mxschmitt mxschmitt merged commit 8229ee5 into main Nov 13, 2023
36 of 38 checks passed
@mxschmitt mxschmitt deleted the fix-page-pause-timeout-reset branch November 13, 2023 16:45
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] timeout not properly restored in pause()
2 participants