Skip to content
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

Shutdown of WebTestHttpd from wptserve takes about 0.5s #46710

Open
whimboo opened this issue Jun 12, 2024 · 0 comments
Open

Shutdown of WebTestHttpd from wptserve takes about 0.5s #46710

whimboo opened this issue Jun 12, 2024 · 0 comments

Comments

@whimboo
Copy link
Contributor

whimboo commented Jun 12, 2024

Calling httpd.stop() as in the example below takes 0.5s each time. I didn't further measure but because of that issue tests that are starting and stopping the server each time see a drastic decrease in runtime.

    httpd = server.WebTestHttpd(
        host="127.0.0.1",
        port=0,
        doc_root=os.path.join(HERE, 'data'),
        routes=routes,
        )

    httpd.start()
    [..]
    httpd.stop()

CC @jgraham in case you have an idea. Workaround for now is to reduce the number of httpd server start and shutdowns to only those cases when it is really needed.

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

No branches or pull requests

1 participant