jscheffl opened a new issue, #57515:
URL: https://github.com/apache/airflow/issues/57515

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   While improving code linting rules I noticed that the test
   test_async_write_logs_should_execute_successfully() in 
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_pod.py is 
not correctly implemented.
   
   It is checking logs but mock is either not catching the right log calls or 
the mocked od instance is not in a state that logs are read at all.
   Both True/False paramerized calls are not working:
   - The call checking for log messages asserts a string only w/o checking the 
real logs grabbed from pod.
   - The check w/o fetching logs checks a fixture not being called which is 
mocking the wrong function which anyway will never be called.
   
   
   Added a inverted test for a call for the True case which now shows it is 
failing and marked the test as XFail.
   
   The broken test has been introduced in 
https://github.com/apache/airflow/pull/29017/files#diff-9eab8bfed52232ef1125033c59024d9ed878b6504b830ba633aa2ad7d1f60151R1342
   
   FYI @VladaZakharova
   
   ### What you think should happen instead?
   
   The logs should be properly checked if possible (unsure whether logs are 
actually gabbed in deferred more, re-entry?)
   
   ### How to reproduce
   
   Enter a shell with breeze and call
   ```
   pytest 
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_pod.py
   ```
   If the `@pytest.mark.xfail` is removed as decorator the test should show a 
failure trace.
   
   ### Operating System
   
   Linux, but unrelevant for the issue.
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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