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]: Origin Private File System is not isolated between tests #29901

Open
karyon opened this issue Mar 12, 2024 · 4 comments · Fixed by #29921
Open

[Bug]: Origin Private File System is not isolated between tests #29901

karyon opened this issue Mar 12, 2024 · 4 comments · Fixed by #29921

Comments

@karyon
Copy link

karyon commented Mar 12, 2024

Version

1.42.1

Steps to reproduce

  1. Clone https://github.com/karyon/playwright-examples
  2. git checkout opfs-should-be-cleared
  3. In VSCode extension, enable "Show Browser"
  4. Run opfs test in opfs-should-be-cleared.spec.ts
  5. Without closing the browser, run it again

Expected behavior

It succeeds twice

Actual behavior

It fails the second time

Additional context

https://playwright.dev/docs/browser-contexts uses very strong wording: "Every test runs independently from any other test. This means that each test has its own local storage, session storage, cookies etc. ... equivalent to incognito-like profiles ... completely isolated, even when running in a single browser."

This does not seem to apply to the Origin Private File System . The test in the example repo checks whether a directory exists and if not, creates it. The second run sees the directory created by the first one. For comparison, I wrote a similar test with localStorage, where it works as expected.

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
    Memory: 6.92 GB / 31.76 GB
  Binaries:
    Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.4 - C:\Program Files\nodejs\pnpm.CMD
  IDEs:
    VSCode: 1.85.2 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.26 - C:\Program Files\Git\usr\bin\bash.EXE
  npmPackages:
    @playwright/test: ^1.42.1 => 1.42.1
@mxschmitt
Copy link
Member

https://playwright.dev/docs/browser-contexts uses very strong wording: "Every test runs independently from any other test. This means that each test has its own local storage, session storage, cookies etc. ... equivalent to incognito-like profiles ... completely isolated, even when running in a single browser."

While this statement is correct when running the tests on CI, via Terminal or via UI Mode, in VSCode this is only a best-effort approach as you discovered. We do this in order to provide a re-usable page experience instead of flickering / having a new page for each test. (So better DX while we hunt the edge-cases like this one).

Thanks for writing a test! I created a fix for it.

@mxschmitt mxschmitt self-assigned this Mar 13, 2024
mxschmitt added a commit that referenced this issue Mar 15, 2024
Fixes #29901

This clears the Origin Private File System API when using VSCode
extension.
@mxschmitt mxschmitt reopened this Apr 11, 2024
@mxschmitt
Copy link
Member

Reopening since it caused a upstream Chromium bug, we'll revisit it in the future once the Chromium bug has been fixed.

@pavelfeldman
Copy link
Member

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

@karyon
Copy link
Author

karyon commented Aug 16, 2024 via email

@mxschmitt mxschmitt reopened this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants