Skip to content

Conversation

brendandahl
Copy link
Collaborator

This is in preparation for the parallel browser tests where sub processes aren't allowed.

The server no longer changes the directory during tests, since we can now rely on the test runner changing the directory (same process).

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

Can you remind me why "sub processes aren't allowed."?

test/common.py Outdated

class ServerThread(threading.Thread):
"""A generic thread class to create and run a server."""
def __init__(self, server_creator, *server_args):
Copy link
Collaborator

Choose a reason for hiding this comment

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

server_ctor or server_constructor.. or maybe server_class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It takes a function, so I don't think those names work.

@brendandahl
Copy link
Collaborator Author

Can you remind me why "sub processes aren't allowed."?

Workers in the pool are already daemon processes and do not allow you to create sub processes.

More on the daemonic stuff: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.daemon

This is in preparation for the parallel browser tests where sub processes
aren't allowed.

The server no longer changes the directory during tests, since we can now
rely on the test runner changing the directory (same process).
test/common.py Outdated

cls.harness_in_queue = queue.Queue()
cls.harness_out_queue = queue.Queue()
cls.harness_server = HttpServerThread(harness_server_func, cls.harness_in_queue, cls.harness_out_queue, cls.PORT)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we at least rename harness_server_func to something like make_test_server or make_test_harness since that function now returns that server rather than running it?

@brendandahl brendandahl merged commit c70edc6 into emscripten-core:main Sep 3, 2025
30 checks passed
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