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 d67e8e83fa Fix quarantined test (#35427)
d67e8e83fa is described below
commit d67e8e83fa543e9cfae6b096f3e9e6b6bd8ca025
Author: Daniel DylÄ…g <[email protected]>
AuthorDate: Sat Nov 4 00:03:26 2023 +0100
Fix quarantined test (#35427)
initialize_airflow_tests fixture contains logging setup which interferes
with capsys. capsys must be invoked before any logger setup to work correctly
but this kind of fixture ordering is difficult to enforce. The solution is to
replace capsys with caplog which doesn't suffer from the problem.
Co-authored-by: daniel.dylag <[email protected]>
---
tests/jobs/test_triggerer_job.py | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/tests/jobs/test_triggerer_job.py b/tests/jobs/test_triggerer_job.py
index 2df98f9a73..c38fbb3d0b 100644
--- a/tests/jobs/test_triggerer_job.py
+++ b/tests/jobs/test_triggerer_job.py
@@ -112,10 +112,7 @@ def create_trigger_in_db(session, trigger, operator=None):
return dag_model, run, trigger_orm, task_instance
-# Quarantined because this test is failing the first time it is run. The
second time succeeds
-# Seems to be connected with SOME race condition and needs to be investigated
[email protected]
-def test_trigger_logging_sensitive_info(session, capsys):
+def test_trigger_logging_sensitive_info(session, caplog):
"""
Checks that when a trigger fires, it doesn't log any sensitive
information from arguments
@@ -153,10 +150,9 @@ def test_trigger_logging_sensitive_info(session, capsys):
# Since we have now an in-memory process of forwarding the logs to stdout,
# give it more time for the trigger event to write the log.
time.sleep(0.5)
- stdout = capsys.readouterr().out
- assert "test_dag/test_run/sensitive_arg_task/-1/1 (ID 1) starting" in
stdout
- assert "some_password" not in stdout
+ assert "test_dag/test_run/sensitive_arg_task/-1/1 (ID 1) starting" in
caplog.text
+ assert "some_password" not in caplog.text
def test_is_alive():