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

Tests: Explicitly set multiprocessing start method to "fork" #405

Merged
merged 1 commit into from
Mar 26, 2021
Merged
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
8 changes: 4 additions & 4 deletions src/crate/client/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import random
import traceback
from http.server import BaseHTTPRequestHandler, HTTPServer
from multiprocessing.context import ForkProcess
from unittest import TestCase
from unittest.mock import patch, MagicMock
from threading import Thread, Event
from multiprocessing import Process
from decimal import Decimal
import datetime as dt
import urllib3.exceptions
Expand Down Expand Up @@ -396,7 +396,7 @@ class KeepAliveClientTest(TestCase):

def __init__(self, *args, **kwargs):
super(KeepAliveClientTest, self).__init__(*args, **kwargs)
self.server_process = Process(target=self._run_server)
self.server_process = ForkProcess(target=self._run_server)

def setUp(self):
super(KeepAliveClientTest, self).setUp()
Expand Down Expand Up @@ -529,8 +529,8 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.assertIsNotNone(self.request_handler)
self.server_address = ('127.0.0.1', random.randint(65000, 65535))
self.server_process = Process(target=TestingHTTPServer.run_server,
args=(self.server_address, self.request_handler))
self.server_process = ForkProcess(target=TestingHTTPServer.run_server,
args=(self.server_address, self.request_handler))

def setUp(self):
self.server_process.start()
Expand Down