Skip to content

Cleanup the emscripten tests relating to the event loop. NFC #23760

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 25, 2025

The browser tests were only being run in PROXY_TO_PTHREAD mode
for some reason even though these tests should pass on the main thread.

In test_other the PROXY_TO_PTHREAD flags were being passed as args
(rather then emcc_args). Likely a copy/paste bug.

@sbc100 sbc100 force-pushed the event_loop_tests branch 2 times, most recently from f2af566 to 6970efe Compare February 25, 2025 22:08
@sbc100 sbc100 changed the title Cleanup event loop tests. NFC Decrement keepalive counter in emscripten_clear_timeout Feb 25, 2025
@sbc100 sbc100 requested a review from kripken February 25, 2025 22:09
@sbc100 sbc100 force-pushed the event_loop_tests branch 3 times, most recently from 295f2fc to c1a2f16 Compare February 25, 2025 22:22
The browser tests were only being run in `PROXY_TO_PTHREAD` mode
for some reason even though these tests should pass on the main thread.

In test_other the `PROXY_TO_PTHREAD` flags were being passed as args
(rather then emcc_args).  Likely a copy/paste bug.
@sbc100 sbc100 changed the title Decrement keepalive counter in emscripten_clear_timeout Cleanup the emscripten tests relating to the event loop. NFC Feb 26, 2025
@sbc100 sbc100 requested a review from kripken February 26, 2025 00:27
@sbc100 sbc100 enabled auto-merge (squash) February 26, 2025 00:27
self.btest_exit('gl_textures.c', args=['-lGL', '-g', '-sSTACK_SIZE=1MB'] + args)
@also_with_proxy_to_pthread
def test_gl_textures(self):
self.btest_exit('gl_textures.c', args=['-lGL', '-g', '-sSTACK_SIZE=1MB', '-sOFFSCREEN_FRAMEBUFFER'])
Copy link
Member

Choose a reason for hiding this comment

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

This did not always test with OFFSCREEN_FRAMEBUFFER before. Do we not error on that being used without pthreads?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I think think its harmlessly ignored.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we should error ? But we don't today.

def test_emscripten_set_interval(self):
self.do_runf('emscripten_set_interval.c', args=['-pthread', '-sPROXY_TO_PTHREAD'])
self.do_runf('emscripten_set_interval.c')
Copy link
Member

Choose a reason for hiding this comment

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

Previously this was tested with pthreads, but now it isn't, if I read this diff correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, see the PR description. There is a typo here. args should be emcc_args so this was never working here. args in this context refers to arguments for the program itself.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Should we fix the typo and test it with pthreads, or not?

Copy link
Member

Choose a reason for hiding this comment

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

I can't think of a reason to use pthreads on this myself. lgtm either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We test with and without threads in the browser already.

def test_emscripten_set_interval(self):
self.do_runf('emscripten_set_interval.c', args=['-pthread', '-sPROXY_TO_PTHREAD'])
self.do_runf('emscripten_set_interval.c')
Copy link
Member

Choose a reason for hiding this comment

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

I can't think of a reason to use pthreads on this myself. lgtm either way.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants