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



##########
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:
       That would not work. The returned values do not have EOL. They are 
prefixed with spaces: 
   
   ```
          1
          2
     234333
   ```
   




-- 
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:
[email protected]


Reply via email to