Shrividya commented on code in PR #67719:
URL: https://github.com/apache/airflow/pull/67719#discussion_r3328061327


##########
airflow-core/tests/unit/jobs/test_triggerer_job.py:
##########
@@ -1051,6 +1051,48 @@ async def asend_side_effect(msg):
         assert len(first_call.events) == 3
         assert len(second_call.events) == 2
 
+    @pytest.mark.parametrize(
+        "payload",
+        [
+            pytest.param(
+                {"event": "hello"},
+                id="missing-level-key",
+            ),
+            pytest.param(
+                {"event": "hello", "level": "bogus_unknown_level"},
+                id="unknown-level-value",
+            ),
+        ],
+    )
+    def test_process_log_messages_tolerates_bad_level(self, payload):
+        """Log events with missing or unknown 'level' must not raise 
KeyError."""
+        import json
+
+        trigger_runner = TriggerRunner()
+        gen = trigger_runner._process_log_messages_from_subprocess()
+        next(gen)  # advance to yield
+
+        # Must not raise KeyError (the bug this test guards against)

Review Comment:
   this case only checks if exception is not raised. Missing log lines is still 
silently ignored



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