playwright
playwright copied to clipboard
[Bug]: Worker-scoped fixture execution terminates before timeout
Version
1.43.1
Steps to reproduce
- clone my repo -
git clone [email protected]:NoamGaash/never-ending-fixture.git - npm install
- npx playwright test -g "my test"
Expected behavior
- I expect to see both
"Fixture teardown starts"and"Fixture teardown ends"log messages - I expect the string
"will never be thrown"to be thrown - I expect the teardown to take at least 40 seconds
Actual behavior
- The "Fixture teardown starts" text appears, but "Fixture teardown ends" is missing
- The test takes 30.2s
- No exception is thrown
Additional context
The documentation states that:
for slow fixtures, especially worker-scoped ones, it is convenient to have a separate timeout
That's why I believe timeouts are expected to work for worker-scoped fixtures.
Environment
System:
OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
Memory: 14.82 GB / 31.01 GB
Container: Yes
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn
npm: 9.5.1 - ~/.nvm/versions/node/v18.12.1/bin/npm
IDEs:
VSCode: 1.88.1 - /usr/bin/code
Languages:
Bash: 5.2.15 - /usr/bin/bash
npmPackages:
@playwright/test: ^1.43.1 => 1.43.1
Investigation note:
- worker is stopped
- graceful worker termination is scheduled concurrently with the worker teardown
@dgozman
Thank you for addressing this issue.
Few words regarding our use case:
In every test, we are uploading test related resources to our servers. We don't want this long operation to block the worker from proceeding the run with other tests, that's why we use fixtures to wait for this operation to be completed during worker's teardown.
As a workaround, we have placed the waiting in an afterAll clause added to every test file, but performance-wise it's a terrible idea as the worker is stopped from running the next test file until the upload operation is completed.
Having the ability to use worker-scope teardown could make our (and our some of our clients) test-suite twice as fast.
I hope this explanation shed some light on why this issue is important for us, I'm here to help so please let me know if there's anything I can explain or do better.
Thank you very much! :pray: