Skip to content

Commit

Permalink
Merge pull request #327 from Pylons/speedup-test-suite
Browse files Browse the repository at this point in the history
If we are not on Windows use fork for multiprocessing
  • Loading branch information
mmerickel committed Nov 26, 2020
2 parents 31d7498 + ab5bbae commit 29bd138
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import unittest

from waitress import server
from waitress.compat import WIN
from waitress.utilities import cleanup_unix_socket

dn = os.path.dirname
Expand Down Expand Up @@ -76,7 +77,12 @@ def start_subprocess(self, target, **kw):
if "COVERAGE_RCFILE" in os.environ:
os.environ["COVERAGE_PROCESS_START"] = os.environ["COVERAGE_RCFILE"]

self.proc = multiprocessing.Process(
if not WIN:
ctx = multiprocessing.get_context("fork")
else:
ctx = multiprocessing.get_context("spawn")

self.proc = ctx.Process(
target=start_server,
args=(target, self.server, self.queue),
kwargs=kw,
Expand Down

0 comments on commit 29bd138

Please sign in to comment.