andreahlert commented on code in PR #61630:
URL: https://github.com/apache/airflow/pull/61630#discussion_r3295882410


##########
airflow-core/tests/unit/serialization/test_serialized_objects.py:
##########
@@ -1063,8 +1063,11 @@ def test_logging_propogated_by_default(self, caplog):
         BaseOperator(task_id="test").log.warning("test")
         # This looks like "how could it fail" but this actually checks that 
the handler called `emit`. Testing
         # the other case (that when we have set_context it goes to the file is 
harder to achieve without
-        # leaking a lot of state)
-        assert caplog.messages == ["test"]
+        # leaking a lot of state). Only assert on the operator's logger so 
other loggers (e.g. OTLP trace
+        # export errors in CI) do not affect the test.
+        operator_logger_prefix = "airflow.task.operators"
+        operator_messages = [r.message for r in caplog.records if 
r.name.startswith(operator_logger_prefix)]

Review Comment:
   Fair, the scope creep is real. Kept it in this PR since it surfaced while 
debugging the CI flake that was blocking the merge, but called it out 
explicitly under "Out-of-scope change included" in the description, referencing 
commit f2f1f3c5c9 so it stays discoverable if it ever needs to be bisected.



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