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

exclude msw from vite dep optimization to fix playwright tests #29

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

jschuurk-kr
Copy link
Contributor

@jschuurk-kr jschuurk-kr commented Apr 24, 2024

analysis and solution

Playwright tests were failing, depending on which ones you run and on the number of Playwright workers. A consistent way to reproduce the problem was to run all tests with 3 Playwright workers. This caused the app e2e tests to fail beacuse of a 504 Outdated Optimize Dep response from node_modules/.vite/deps/msw.js.

Excluding msw from the vite dep optimization seems to fix this issue. Note that using the --force flag or config option for vite dep optimization, might improve the situation, but didn't solve it.

closes #28

notes on testing

npm run e2e -- --workers 3 consistently reproduced the issue, so that's a good start.

npm run e2e -- --workers 8 did not reproduce the issue on my machine, so it's a good idea to play around with the number of workers. Note that --workers also accepts a percentage, e.g. --workers 50% (percentage of logical CPU cores).

npm run e2e should work, because that's the default way of running.

Note that when running on GitHub Actions, number of workers is set to 100% through playwright.config.ts, i.e. both of the available cores. Which explains why this issue has not been occurring in our pipeline.

Playwright tests were failing, depending on which ones you run
and on the number of Playwright workers. A consistent way to
reproduce the problem was to run all tests with 3 Playwright workers.
This caused the app e2e tests to fail beacuse of a 504 Outdated
Optimize Dep response from node_modules/.vite/deps/msw.js.

Excluding msw from the vite dep optimization seems to fix this issue.
Note that using the --force flag or config option for vite dep
optimization, might improve the situation, but didn't solve it.
@praseodym
Copy link
Contributor

lgtm, npm run e2e works on my machine now! 🥳

praseodym
praseodym previously approved these changes Apr 24, 2024
@jschuurk-kr
Copy link
Contributor Author

jschuurk-kr commented Apr 24, 2024

more on the pipeline issue with installing playwright: actions/runner-images#9733

temp fix might be to change runs-on: ubuntu-latest to runs-on: ubuntu-20.04

@praseodym
Copy link
Contributor

praseodym commented Apr 24, 2024

more on the pipeline issue with installing playwright: actions/runner-images#9733

temp fix might be to change runs-on: ubuntu-latest to runs-on: ubuntu-20.04

I assume this will be fixed soon, so let's just review this as if the pipeline ran successfully. If it's not fixed by the end of the day/tomorrow morning(?), this fix by a GitHub employee seems like the way to go.

@jschuurk-kr
Copy link
Contributor Author

issue with the Microsoft Ubuntu 22.04 repos was fixed! 🎉

@jschuurk-kr jschuurk-kr merged commit 2d902b2 into main Apr 25, 2024
2 checks passed
@jschuurk-kr jschuurk-kr deleted the fix-workers-playwright-tests branch April 25, 2024 13:25
lkleuver pushed a commit that referenced this pull request Apr 26, 2024
exclude msw from vite dep optimization

Playwright tests were failing, depending on which ones you run
and on the number of Playwright workers. A consistent way to
reproduce the problem was to run all tests with 3 Playwright workers.
This caused the app e2e tests to fail beacuse of a 504 Outdated
Optimize Dep response from node_modules/.vite/deps/msw.js.

Excluding msw from the vite dep optimization seems to fix this issue.
Note that using the --force flag or config option for vite dep
optimization, might improve the situation, but didn't solve it.
lkleuver pushed a commit that referenced this pull request Apr 29, 2024
exclude msw from vite dep optimization

Playwright tests were failing, depending on which ones you run
and on the number of Playwright workers. A consistent way to
reproduce the problem was to run all tests with 3 Playwright workers.
This caused the app e2e tests to fail beacuse of a 504 Outdated
Optimize Dep response from node_modules/.vite/deps/msw.js.

Excluding msw from the vite dep optimization seems to fix this issue.
Note that using the --force flag or config option for vite dep
optimization, might improve the situation, but didn't solve it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playwright tests fail with >2 workers
3 participants