playwright: [BUG] Failed worker - Error: ENOENT: no such file or directory ...
System info
- Playwright Version: v1.34.0
- Operating System: Ubuntu 22
- Browser: WebKit
- Other info:
Source code
I can not provide code, this is only to see if you have a guess what could have happened here. Or to find other playwright users with the same issue.
The CI failed with, while all tests did pass:
✓ 15 [webkit] › one_of_my_tests.spec.ts:51:7 › One of my tests (15.9s)
Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/test-results/.playwright-artifacts-2/traces/e69fa91c7a5aeb5562f4-a3b0bd93b675913377a5-3.network'
Failed worker ran 5 tests:
[webkit] › src/tests/....spec.ts:13:7 › Another test
[webkit] › src/tests/....spec.ts:99:7 › Another test
[webkit] › src/tests/....spec.ts:8:5 › Another test
[webkit] › src/tests/one_of_my_tests.spec.ts:14:7 › Another test
[webkit] › src/tests/one_of_my_tests.spec.ts:51:7 › One of my tests
The last statement of the last test did inspect the networking via
const response = await page.waitForResponse(`${process.env.BASE_URL}/deep/link`)
const responseBody = JSON.parse(await response.text())
expect(response.status()).toBe(200)
Could the not found ‘.network’ be a temporary file of inspecting the network? Or could you tell what the ‘.network’ files are good for to narrow down the problem?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 28 (4 by maintainers)
Commits related to this issue
- fix(tracing): avoid trace file name collisions (#24191) We have been optionally adding `-<number>` in multiple places, and these might collide in various circumstances, for example: two contexts at ... — committed to microsoft/playwright by dgozman a year ago
- fix(tracing): only access tracing state on the API calls, not inside trace operations (#24212) References #23387. — committed to microsoft/playwright by dgozman a year ago
- fix(tracing): avoid trace file name collisions (#24191) We have been optionally adding `-<number>` in multiple places, and these might collide in various circumstances, for example: two contexts at ... — committed to OctoMind-dev/playwright by dgozman a year ago
- fix(tracing): only access tracing state on the API calls, not inside trace operations (#24212) References #23387. — committed to OctoMind-dev/playwright by dgozman a year ago
Couldn’t find a command in the documentation, so I just deleted the folder and it worked.
Something is clearly broken with this cache. I and a colleague locally are experiencing this problem
This is occurring for me as well, only in CI on Jenkins with the same error:
Test passed but then the following error message breaks the test
Error: ENOENT: no such file or directory, open '/home/jenkins/agent/workspace/<project_name>_PR-1/test-results/.playwright-artifacts-0/traces/843f88e1fda41d8e559e-2994db754a0a9a3a89af.trace'I can see similar errors on our CI (Jenkins) and I cannot reproduce that error on my local machine.
The latest statements: 2023-06-06T09:23:56.825Z] [2023-06-06T09:23:56.825Z] 13 passed (4.9m)
[2023-06-06T09:23:56.825Z] [2023-06-06T09:23:56.825Z] 1 error was not a part of any test, see above for details
I am on 1.39 and still get this occasionally - only way around is to manually clear cache
I also noticed that there is an issue with the cache. Removing the cache folder helped. I suspect it could be an issue when
npx playwrightis used at some places. So I just useyarn playwrightinstead …Is there a command to clear this broken cache ?
Not sure if this helps,
I upgraded from 1.32.2 to 1.37.1 and then I got
Error: end of central directory record signature not foundandError: ENOENT: no such file or directory, open '/my-test/test-results/.playwright-artifacts-2/8ecfe60c5012dcb08b07f04e2a41444d.zip'only when using--trace=on(everything OK in 1.32.2), and I found that it happened only on a test file not all tests.So I was looking what’s different between them, I saw that the errors always appear after the steps in
beforeAllfinish, and found that I had abeforeAlllike this:Thus I added
awaitoncontext.close();:Then the errors have gone after I added the
await!I have the similar error but in my case Playwright freezes immediately after
ENOENT: no such file or directory. The strangest part is thattest-resultsfolder doesn’t have anything that looks like.playwright-artifacts-.Last moments in logs:
Logs after ctrl+C:
Logs that appears in terminal in few seconds after killing process with ctrl+c:
UPD1: It looks like it happens only if there is a failed test.
UPD2: only if there is a failed test that fails by throwing uncaught error.