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

[Bug]: no video and no screenshots in trace in case of action timeout during fixture cleanup (tearing down) #31537

Closed
svlobanov opened this issue Jul 3, 2024 · 4 comments · Fixed by #32160
Assignees
Labels

Comments

@svlobanov
Copy link

Version

1.45.1

Steps to reproduce

  1. Clone my repo: git clone https://github.com/svlobanov/playwright-bug-fixture-cleanup
  2. npm ci
  3. npx playwright install --with-deps
  4. npx playwright test

Test will fail, it's expected, but video will not be recorded, also trace doesn't have any screenshots/snapshots. You can see the result of execution here: https://github.com/svlobanov/playwright-bug-fixture-cleanup/actions/runs/9777308480

If comment this line: https://github.com/svlobanov/playwright-bug-fixture-cleanup/blob/810a8ed930ea85cae446062702594d3780519b5f/fixtures/player.ts#L25 , the video will be saved.

Expected behavior

Video should be saved even if action timed out during fixture cleanup

Actual behavior

Video is not saved, trace doesn't have snapshots/screenshots

Additional context

No response

Environment

% npx envinfo --preset playwright

  System:
    OS: macOS 14.1
    CPU: (8) arm64 Apple M1
    Memory: 55.59 MB / 16.00 GB
  Binaries:
    Node: 22.2.0 - /opt/homebrew/bin/node
    npm: 10.7.0 - /opt/homebrew/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.45.1 => 1.45.1 

The same issue on Linux Ubuntu 22.04 (see here: https://github.com/svlobanov/playwright-bug-fixture-cleanup/actions/runs/9777308480/job/26991697102)
@mxschmitt
Copy link
Member

mxschmitt commented Jul 3, 2024

Investigation notes: I can repro, if the fixture times out in the teardown (via e.g. page.click), no video is getting saved. Not sure if we can do much there.

@svlobanov
Copy link
Author

@mxschmitt sorry, but I didn't get you (your comment + v1.46 label). this issue can't be fixed or you plan to fix it in v1.46?
If it can't be fixed, what is best practice?
My use case: I'm creating some objects in fixture setup, e.g. I create a new user in the system, then test code is executed (e.g. I'm checking that created user has granted access), then I need to delete the user from the system in fixture tear-down code, otherwise tested system will constantly increase (if I don't delete the objects created for tests)

@svlobanov
Copy link
Author

Also this issue is not only about missing video, traces don't have screenshots and snapshots, you can check it locally or via downloading the artifact here: https://github.com/svlobanov/playwright-bug-fixture-cleanup/actions/runs/9777308480

@mxschmitt
Copy link
Member

@svlobanov these were investigation notes. No action needed from your side anymore. We'll look at it. Thank you!

dgozman added a commit that referenced this issue Jul 6, 2024
Retaining traces in the following scenarios:
- browser crash;
- manual `browser.close()`;
- implicit `browser.close()` from the `browser` fixture upon test end.

This does not affect the library, where `browser.close()` will not
retain the trace and will close the browser as fast as possible.

References #31541, #31535, #31537.
@dgozman dgozman added v1.47 and removed v1.46 labels Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants