Skip to content

Commit 2105eaa

Browse files
authored
Disable grpc fork support on some test suites. (#38566)
* Disable grpc fork support in some test suite. * Disable GRPC fork support. * Add TODOs
1 parent f22400a commit 2105eaa

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

sdks/python/apache_beam/runners/portability/portable_runner_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import inspect
2020
import logging
21+
import os
2122
import socket
2223
import subprocess
2324
import sys
@@ -328,6 +329,22 @@ class PortableRunnerTestWithSubprocessesAndMultiWorkers(
328329
PortableRunnerTestWithSubprocesses):
329330
_use_subprocesses = True
330331

332+
# TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed.
333+
@classmethod
334+
def setUpClass(cls):
335+
cls._old_fork_support = os.environ.get('GRPC_ENABLE_FORK_SUPPORT')
336+
os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'false'
337+
super().setUpClass()
338+
339+
# TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed.
340+
@classmethod
341+
def tearDownClass(cls):
342+
if cls._old_fork_support is None:
343+
os.environ.pop('GRPC_ENABLE_FORK_SUPPORT', None)
344+
else:
345+
os.environ['GRPC_ENABLE_FORK_SUPPORT'] = cls._old_fork_support
346+
super().tearDownClass()
347+
331348
def create_options(self):
332349
options = super() \
333350
.create_options()

sdks/python/apache_beam/utils/subprocess_server_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@
3737

3838

3939
class JavaJarServerTest(unittest.TestCase):
40+
41+
# TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed.
42+
@classmethod
43+
def setUpClass(cls):
44+
cls._old_fork_support = os.environ.get('GRPC_ENABLE_FORK_SUPPORT')
45+
os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'false'
46+
super().setUpClass()
47+
48+
# TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed.
49+
@classmethod
50+
def tearDownClass(cls):
51+
if cls._old_fork_support is None:
52+
os.environ.pop('GRPC_ENABLE_FORK_SUPPORT', None)
53+
else:
54+
os.environ['GRPC_ENABLE_FORK_SUPPORT'] = cls._old_fork_support
55+
super().tearDownClass()
56+
4057
def test_gradle_jar_release(self):
4158
self.assertEqual(
4259
'https://repo.maven.apache.org/maven2/org/apache/beam/'

0 commit comments

Comments
 (0)