Skip to content

Commit

Permalink
fix:do not change global start_method for multiprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
1C4nfaN committed Oct 13, 2023
1 parent 3d03925 commit df2529e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_oneway.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def Test(self, req):


oneway_thrift = thriftpy2.load("oneway.thrift", module_name="oneway_thrift")
multiprocessing.set_start_method("fork")


class TestOneway(object):
def setup_class(self):
ctx = multiprocessing.get_context("fork")
server = make_server(oneway_thrift.echo, Dispatcher(), '127.0.0.1', 6000)
self.p = multiprocessing.Process(target=server.serve)
self.p = ctx.Process(target=server.serve)
self.p.start()
time.sleep(1) # Wait a second for server to start.

Expand Down

0 comments on commit df2529e

Please sign in to comment.