-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
[test-runner] Advanced Concurrency Settings #238
Comments
This is an interesting problem. You don't get it with chromium or webkit? Is this with puppeteer or playwright? For puppeteer it's still in an experimental stage, and for playwright I'm not sure how official their solution is. It would be worth filing issues for this so that is can be fixed properly. Did this work in Karma? Of course tests all run in a single window, but if you run multiple browsers firefox would still not have the focus. @daKmoR you've had a lot of experience with focus in tests, any tips you can give here? |
I think I can reproduce the behavior also via lion/form-core... It works fine in chrome launcher, in playwright chromium, webkit and in puppeteer... so only firefox fails when running via "headless" however if I watch and use debug then the tests work fine 😅 |
Yes, I'm experiencing this with Firefox via Playwright. This did not occur previously with Karma, even with the concurrency way up. In theory, being headless means that
I think this is now applying these settings correctly (some of them were causing a crash previous to |
I tested it yesterday in Firefox via browserstack as well and that runs fine 💪 Soo probably something to do how playwright starts Firefox... 🤔 what I didn't test yet is puppeteer and Firefox 🤔 |
One possible route here is to use separate browser instances rather than separate tabs. I'm not sure what the effect will be on performance, I think we'd lose cross-page caching :( |
Hrm. If it's working in browser stack and not locally then I'd think it's even more likely the prefs aren't being loaded correctly. Various parts of the prefs were needed to turn off things that were mostly happening on local Firefox builds... Particularly, things like |
But, I guess that would more likely align with it always failing locally... and right now if you reduce concurrency is doesn't have any issues. 😖 |
Do you think you'd be able to reduce this to a minimal test case? Maybe even with puppeteer/playwright alone? That would be help experimenting with different solutions. |
Wanted to mention I still notice focus related tests failing for us too on Playwright Firefox with concurrency greater than 2. |
If we have a small test case we can dig deeper into this. |
Here's one that fails for focusing a text input component. Passes on WebKit and Chromium.
|
With #710 you can set concurrency per browser launcher. For example: import { playwrightLauncher } from '@web/test-runner-playwright';
export default /** @type {import('@web/test-runner').TestRunnerConfig} */ ({
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'webkit' }),
playwrightLauncher({ product: 'firefox', concurrency: 1 }),
],
}); You could also use groups to only run a selection of tests with a concurrency of 1: import { playwrightLauncher } from '@web/test-runner-playwright';
export default /** @type {import('@web/test-runner').TestRunnerConfig} */ ({
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'webkit' }),
playwrightLauncher({ product: 'firefox' }),
],
groups: {
name: 'focus-tests',
files: 'test/focus/**/*.test.js',
browsers: [
playwrightLauncher({ product: 'firefox', concurrency: 1 }),
]
}
}); |
When running tests in Firefox that rely on focus being present in the browser, running at a concurrency above 1 can create a situation wherein the browser/tab of the test is not currently in focus and the assertions therein will fail (rather flakily, too).
Thinking through possible approaches to the situation:
headless: true
isn't really "headless" for that launcher? I also triedlaunchOptions.args = ['-headless']
to similar effect.Thoughts?
The text was updated successfully, but these errors were encountered: