You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/06/21 17:52:34 UTC

[airflow] branch main updated: Fix occasional test failures where pid matches part of another PID (#24584)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 14893b8501 Fix occasional test failures where pid matches part of another PID (#24584)
14893b8501 is described below

commit 14893b8501f47460e6fdab367671440545ee9c6b
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Tue Jun 21 19:52:27 2022 +0200

    Fix occasional test failures where pid matches part of another PID (#24584)
    
    Solves problems that intermittently fail our builds:
    
    ```
      '135' is contained here:
        ith pid: 10135
      ?            +++
    ```
---
 tests/jobs/test_local_task_job.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/jobs/test_local_task_job.py b/tests/jobs/test_local_task_job.py
index 298e5b9a63..72246086a9 100644
--- a/tests/jobs/test_local_task_job.py
+++ b/tests/jobs/test_local_task_job.py
@@ -462,7 +462,7 @@ class TestLocalTaskJob:
         assert len(lines) == 1  # invoke once
         assert lines[0].startswith(ti.key.primary)
         this_pid = str(os.getpid())
-        assert this_pid not in lines[0]
+        assert f"pid: {this_pid}" not in lines[0]
 
     def test_mark_success_on_success_callback(self, caplog, get_test_dag):
         """
@@ -568,7 +568,7 @@ class TestLocalTaskJob:
             assert lines[0].startswith(ti.key.primary)
 
             this_pid = str(os.getpid())
-            assert this_pid not in lines[0]  # ensures callback is NOT run by LocalTaskJob
+            assert f"pid: {this_pid}" not in lines[0]  # ensures callback is NOT run by LocalTaskJob
             assert (
                 str(ti.pid) in lines[0]
             )  # ensures callback is run by airflow run --raw (TaskInstance#_run_raw_task)