← Back to Discord Forum

Sharding Tests That Aren’t Fully Parallel

stevanfreebornposted in #help-playwright
Open in Discord

Curious how sharding impacts tests that run in order.

When the sharding occurs will playwright know to keep that set of tests all together?

This thread is trying to answer question "Does Playwright maintain the execution order of tests within a file when sharding?"

2 replies

Playwright orchestrates test execution based on files, so all the tests in a file should get executed together within the same worker process. The same should apply when sharded. If you want tests within the same file to run in parallel, you need to enable that explicitly (https://playwright.dev/docs/test-parallel#parallelize-tests-in-a-single-file). If you need to force tests to run sequentially, you can also set that explicitly (https://playwright.dev/docs/test-parallel#parallelize-tests-in-a-single-file), though it's not recommended.


Thank you!

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.