Skip to content

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt force-pushed the docs/known-issues branch 2 times, most recently from 3e62567 to 516679e Compare May 17, 2021 09:03
README.md Outdated

### `time.sleep()` leads to outdated state

We internally rely on asynchronous operations. When using `time.sleep(5)` they can't be processed internally and by that e.g. the internal storage for pages can't get updated. To fix this behaviour you should use `page.wait_for_timeout(5000)` instead if you are using the synchronous api. For the asynchronous api you can use `await asyncio.sleep(5)`.
Copy link
Member

@pavelfeldman pavelfeldman May 18, 2021

Choose a reason for hiding this comment

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

I would start with the solution:


Always use page.wait_for_timeout(5000) instead of thread.sleep(5).

It is better to not wait for timeout at all, but sometimes it is useful for debugging. In these cases, use our wait method instead of the system one.


@mxschmitt mxschmitt force-pushed the docs/known-issues branch from 18eb8fc to e381d6a Compare May 18, 2021 21:43
@mxschmitt mxschmitt merged commit cfc1030 into microsoft:master May 18, 2021
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.

3 participants