dianfu commented on a change in pull request #17239:
URL: https://github.com/apache/flink/pull/17239#discussion_r707045524



##########
File path: flink-python/pyflink/table/tests/test_dependency.py
##########
@@ -74,8 +74,9 @@ class StreamDependencyTests(DependencyTests, 
PyFlinkStreamTableTestCase):
 
     def setUp(self):
         super(StreamDependencyTests, self).setUp()
+        os.environ['_python_worker_execution_mode'] = "loopback"
         self.st_env = 
TableEnvironment.create(EnvironmentSettings.in_streaming_mode())
-        self.st_env._execution_mode = "loopback"
+        os.environ['_python_worker_execution_mode'] = "process"

Review comment:
       What about changed it as following:
   ```
   origin_execution_mode = os.environ['_python_worker_execution_mode']
   os.environ['_python_worker_execution_mode'] = "loopback"
   try:
       self.st_env = 
TableEnvironment.create(EnvironmentSettings.in_streaming_mode())
   finally:
       if origin_execution_mode is not None:
           os.environ['_python_worker_execution_mode'] = origin_execution_mode
   ```

##########
File path: flink-python/pyflink/testing/test_case_utils.py
##########
@@ -83,13 +83,15 @@ def setUpClass(cls):
         cls.tempdir = tempfile.mkdtemp()
 
         os.environ["FLINK_TESTING"] = "1"
+        os.environ['_python_worker_execution_mode'] = "process"
         _find_flink_home()
 
         logging.info("Using %s as FLINK_HOME...", os.environ["FLINK_HOME"])
 
     @classmethod
     def tearDownClass(cls):
         shutil.rmtree(cls.tempdir, ignore_errors=True)
+        os.environ['_python_worker_execution_mode'] = ""

Review comment:
       del os.environ['_python_worker_execution_mode']




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to