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: make Locator.wait_for timeout safe #56

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

coreyti
Copy link
Member

@coreyti coreyti commented Aug 3, 2024

Previously, failures due to the timeout being reached were treated as unknown, unexpected errors. In such cases, Channel.recv/2 would (and still does) raise.

With this change, we can now match on %Error{type: "TimeoutError"}, which avoids the raise and improves the API.

Note that the change also includes a small "hack": an attempt to ensure that the related GenServer timeout does not occur before the Playwright server timeout.

Fixes issue #55.

@coreyti coreyti force-pushed the issue-55--locator.wait_for branch from 3e1fa39 to 33b83e6 Compare August 5, 2024 05:20
Previously, failures due to the timeout being reached were treated as
unknown, unexpected errors. In such cases, `Channel.recv/2` would `raise`.

With this change, we can now match on `%Error{type: "TimeoutError"}`,
which avoids the `raise` and improves the API.

Note that the change also includes a small "hack": an attempt to ensure
that the related `GenServer` timeout does not occur before the
Playwright server timeout.

Fixes [issue #55](#55).
@coreyti coreyti force-pushed the issue-55--locator.wait_for branch from 33b83e6 to ef07a21 Compare August 5, 2024 05:22
@coreyti coreyti merged commit a6748bc into main Aug 5, 2024
1 check passed
@coreyti coreyti deleted the issue-55--locator.wait_for branch August 5, 2024 05:25
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.

Failures on Locator.wait_for/2 should not lead to crashing of subsequent tests
1 participant