|
6 | 6 | import time |
7 | 7 | from contextlib import contextmanager |
8 | 8 | from datetime import datetime |
9 | | -from multiprocessing.context import ForkContext |
10 | 9 |
|
11 | 10 | from kubernetes.dynamic.exceptions import ResourceNotFoundError |
12 | 11 | from ocp_resources.deployment import Deployment |
|
45 | 44 | ) |
46 | 45 | from utilities.virt import VirtualMachineForTests, fedora_vm_body, running_vm |
47 | 46 |
|
48 | | -# Use fork context to avoid pickling issues with nested functions |
49 | | -_FORK_CONTEXT: ForkContext = multiprocessing.get_context("fork") |
50 | | - |
51 | 47 | LOGGER = logging.getLogger(__name__) |
52 | 48 |
|
53 | 49 |
|
@@ -135,7 +131,7 @@ def _delete_pods_continuously(_client, pod_prefix, namespace_name, ratio, interv |
135 | 131 | except TimeoutExpiredError: |
136 | 132 | LOGGER.info("Pod deleting process finished.") |
137 | 133 |
|
138 | | - return _FORK_CONTEXT.Process( |
| 134 | + return multiprocessing.Process( |
139 | 135 | name="pod_delete", |
140 | 136 | target=_delete_pods_continuously, |
141 | 137 | args=( |
@@ -189,7 +185,7 @@ def _monitor_nginx_server( |
189 | 185 | time.sleep(_sampling_interval) |
190 | 186 | LOGGER.info("HTTP querying finished successfully.") |
191 | 187 |
|
192 | | - return _FORK_CONTEXT.Process( |
| 188 | + return multiprocessing.Process( |
193 | 189 | name="nginx_monitoring", |
194 | 190 | target=_monitor_nginx_server, |
195 | 191 | args=( |
@@ -320,7 +316,7 @@ def _monitor_cluster(): |
320 | 316 | ) |
321 | 317 | time.sleep(interval) |
322 | 318 |
|
323 | | - return _FORK_CONTEXT.Process( |
| 319 | + return multiprocessing.Process( |
324 | 320 | name="cluster_monitoring", |
325 | 321 | target=_monitor_cluster, |
326 | 322 | ) |
|
0 commit comments