You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/30 05:40:16 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #15081: Finish quarantine for test_should_force_kill_process

uranusjr commented on a change in pull request #15081:
URL: https://github.com/apache/airflow/pull/15081#discussion_r603795541



##########
File path: tests/utils/test_process_utils.py
##########
@@ -136,23 +136,21 @@ def test_should_kill_process(self):
         num_process = subprocess.check_output(["ps", "-ax", "-o", "pid="]).decode().count("\n")
         assert before_num_process == num_process
 
-    @pytest.mark.quarantined
     def test_should_force_kill_process(self):
-        before_num_process = subprocess.check_output(["ps", "-ax", "-o", "pid="]).decode().count("\n")
 
         process = multiprocessing.Process(target=my_sleep_subprocess_with_signals, args=())
         process.start()
         sleep(0)
 
-        num_process = subprocess.check_output(["ps", "-ax", "-o", "pid="]).decode().count("\n")
-        assert before_num_process + 1 == num_process
+        all_processes = subprocess.check_output(["ps", "-ax", "-o", "pid="]).decode().splitlines()
+        assert str(process.pid) in map(lambda x: x.strip(), all_processes)

Review comment:
       Would this work?
   
   ```suggestion
           all_processes = subprocess.check_output(["ps", "-ax", "-o", "pid="]).decode().splitlines(keepends=False)
           assert str(process.pid) in all_processes
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org