Skip to content

[test] Cascade the Chrome windows of parallel browser test workers - #28412

Open
juj wants to merge 4 commits into
emscripten-core:mainfrom
juj:chrome_cascade_windows
Open

juj wants to merge 4 commits into
emscripten-core:mainfrom
juj:chrome_cascade_windows

Conversation

@juj

@juj juj commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

On Linux, it is not possible to disable the window backgrounding logic in browser runs, so apply the same window cascading logic as was done on Firefox.

https://issues.chromium.org/issues/590631905

juj and others added 2 commits November 26, 2026 22:41
On Linux, it is not possible to disable the window backgrounding logic in browser runs, so apply the same window cascading logic as was done on Firefox.

https://issues.chromium.org/issues/590631905
Fixes ruff's unused-variable errors for right and bottom, which were
meant as the screen bounds: wrap the cascade around them, like the
Firefox window cascading does, so that the windows of many parallel
workers stay on screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juj added a commit to juj/emscripten that referenced this pull request Nov 29, 2026
juj added a commit to juj/emscripten that referenced this pull request Nov 30, 2026
Comment thread test/browser_common.py
browser_args += f' {config.data_dir_flag}"{browser_data_dir}"'

# In parallel runs, spawn browsers in cascaded window order so each is visible.
if EMTEST_BROWSER_AUTO_CONFIG and parallel_harness and not EMTEST_HEADLESS and hasattr(config, 'window_rect_flags'):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what situation is window_rect_flags not present?

@juj juj Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not present for the Safari and Firefox browser classes, just for Chrome. So this is an OOP-esque way to say "if CHROME:" (and if Firefox adds them in the future, https://bugzilla.mozilla.org/show_bug.cgi?id=2035615 )

@sbc100

sbc100 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Is there no a flag we can pass to instead just disable the "backgrounding logic" ? e.g. --force-foreground?

@juj

juj commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Is there no a flag we can pass to instead just disable the "backgrounding logic" ? e.g. --force-foreground?

--headless will do that. Besides that, in headful runs, I'm not sure why one would want to do it, since it will result in failed tests?

@sbc100

sbc100 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Is there no a flag we can pass to instead just disable the "backgrounding logic" ? e.g. --force-foreground?

--headless will do that. Besides that, in headful runs, I'm not sure why one would want to do it, since it will result in failed tests?

Sorry, my understanding of this change is that you are trying to force chrome to keep all the windows in foreground mode. You are doing this by moving the windows around hoping that chrome will not think any of them are in the background? Is that not right?

@juj

juj commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Yes, that's right. (I'd refer to that as "cascading", you mentioned "backgrounding", which I understood to refer to the startup flags, which unfortunately aren't 100% bomb-proof like the Chrome bug ticket mentions)

Comment thread test/browser_common.py Outdated
config.configure(browser_data_dir)
browser_args += f' {config.data_dir_flag}"{browser_data_dir}"'

# In parallel runs, spawn browsers in cascaded window order so each is visible.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add something like "Sadly, none of the exiting chrome flags for controlling xxx currently work, so this is a workaround for <bug_url>"

@sbc100

sbc100 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Oh! Sorry I didn't see that bug. I think this workaround seems fine, with an added comment about why we cannot use any of the command line flags.

juj and others added 2 commits November 30, 2026 19:27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

3 participants