Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 2, 2023

Fixes: #20820

@sbc100 sbc100 force-pushed the browser_restart branch 2 times, most recently from d1ee177 to 1669eb5 Compare December 2, 2023 20:00
@sbc100 sbc100 requested review from dschuff and kripken December 4, 2023 21:55
@sbc100
Copy link
Collaborator Author

sbc100 commented Dec 5, 2023

ptal

@sbc100 sbc100 force-pushed the browser_restart branch 2 times, most recently from d01472b to cde3b9d Compare December 5, 2023 00:26
EMTEST_SKIP_SIMD: "1"
EMTEST_SKIP_SCONS: "1"
EMTEST_SKIP_NODE_CANARY: "1"
EMTEST_BROWSER: "0"
Copy link
Member

Choose a reason for hiding this comment

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

Why is this now needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this line the attempt to run sockets.test_nodejs_sockets_echo would launch a browser (because test_sockets.py is a browser test suite).

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, but why is this needed now, and not before this PR?

cls.browser_proc.wait(1)
except subprocess.TimeoutExpired:
cls.browser_proc.kill()
cls.browser_proc.wait()
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment about why it makes sense to give it a 1-second chance to exit gracefully? I'm not sure why that is, actually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before this PR we were using python's webbrowser.get(..).open_new(url) which I assume would open the system browser on windows.

After this PR we default to using subprocess.Popen(['google-chrome'...) .. which doesn't work unless you have that browser in the PATH.

However, in this case we don't want to be starting any browser at all.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'm confused. I asked about the terminate/wait/kill/wait sequence here, but you replied about starting the browser? Are those connected in a way I do not understand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Somehow the replies to these comments got mixed up. Here I'm commenting on as to why the EMTEST_BROWSER=0 is needed when running the socket tests on windows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regarding the using of terminate() prior to kill() I added comment.

It just seemed sensible to me to give the browser a chance to exit cleanly before killing with fire.

@sbc100 sbc100 merged commit 1223c36 into emscripten-core:main Dec 5, 2023
@sbc100 sbc100 deleted the browser_restart branch December 5, 2023 18:45
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.

Browser tests often fail with "[no http server activity]"

2 participants