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

force use fork mode to start multiprocess in tests #262

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/test_all_protocols_binary_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import time
import traceback
import multiprocessing
from multiprocessing import Process

import pytest
Expand All @@ -25,6 +26,7 @@
make_client as make_rpc_client
from thriftpy2.transport import TBufferedTransportFactory, TCyMemoryBuffer

multiprocessing.set_start_method("fork", force=True)

if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)
Expand Down
3 changes: 3 additions & 0 deletions tests/test_apache_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import sys
import time
import multiprocessing
from multiprocessing import Process

import pytest
Expand All @@ -19,6 +20,8 @@
from thriftpy2.transport import TMemoryBuffer
from thriftpy2.transport.buffered import TBufferedTransportFactory

multiprocessing.set_start_method("fork", force=True)


def recursive_vars(obj):
if isinstance(obj, six.string_types):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_buffered_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from thriftpy2._compat import CYTHON
logging.basicConfig(level=logging.INFO)

multiprocessing.set_start_method("fork", force=True)

addressbook = thriftpy2.load(path.join(path.dirname(__file__),
"addressbook.thrift"))

Expand Down
2 changes: 2 additions & 0 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from thriftpy2.http import make_server, make_client, client_context, THttpHeaderFactory # noqa
from thriftpy2.thrift import TApplicationException # noqa

multiprocessing.set_start_method("fork", force=True)

addressbook = thriftpy2.load(os.path.join(os.path.dirname(__file__),
"addressbook.thrift"))

Expand Down
2 changes: 2 additions & 0 deletions tests/test_multiplexed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from thriftpy2.transport import TBufferedTransportFactory, TServerSocket


multiprocessing.set_start_method("fork", force=True)

if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_oneway.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from thriftpy2.rpc import make_client, make_server


multiprocessing.set_start_method("fork", force=True)

if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_protocol_cybinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
else:
pytest.skip("cython not enabled.", allow_module_level=True)

multiprocessing.set_start_method("fork", force=True)


class TItem(TPayload):
thrift_spec = {
Expand Down
1 change: 1 addition & 0 deletions tests/test_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from thriftpy2.transport import TTransportException # noqa
from thriftpy2.thrift import TApplicationException # noqa

multiprocessing.set_start_method("fork", force=True)

if sys.platform == "win32":
pytest.skip("requires unix domain socket", allow_module_level=True)
Expand Down
1 change: 1 addition & 0 deletions tests/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
else:
cleanup_on_sigterm()

multiprocessing.set_start_method("fork", force=True)

if sys.platform == "win32":
pytest.skip("requires fork", allow_module_level=True)
Expand Down
Loading