potiuk commented on PR #45631:
URL: https://github.com/apache/airflow/pull/45631#issuecomment-2598517505

   Likely this is a side effect of some other test that does not clean-up after 
itself - you can repeat what CI is doing - i.e. run the `Core` test type:
   
   ```
   breeze testing core-tests --test-type Core
   ```
   
   And they should run the tests in the same sequence the "Core" tests are run 
in CI in your PR (`Core` test type is the one that is failing. 
   
   The problem is that some of the earlier tests likely modify a state stored 
in memory (likely list of executors stored in memory) and do not restore it 
properly - and the failing tests do not set up the state properly.
   
   Now - it's a bit of guessing, art and eventually bisecting to see which 
tests are  causing it. In many cases you can guess - you know which tests you 
added so likely it is somehow related to your changes (but it might be that 
your tests simply ucovered it). What I often do in such cases is trying to 
bisect it - instead of runnin the whole test_type ("Core") - I just enter 
breeze and try to run the same sequence of tests - simply individually rin the 
test packages/modulles that you see printed in the output - so for example from 
the above I try to run (there are some packages that are before that).
   
   ```
   pytest ... tests/models tests/ti_deps tests/utils 
   ```
   
   And see it fails
   
   Now if you run:
   
   ```
   pytest tests/ti_deps tests/utils 
   ```
   
   And it fails - then you know side effect comes from either ti_deps or 
earlier utils - then you can remove ti_deps and see if it fails, then if you 
see tha it comes from utils, you run tests from individual modules in ti_utils 
in the same sequence you see below and remove first half and see if it fails - 
and so on. 
   
   This is by far fastest way of narrowing down which test is creating the 
side-effect if you have no idea.
   
   Here is the example output.
   
   ```
     ....
     tests/models/test_xcom_arg_map.py ...........                            [ 
67%]
     tests/ti_deps/deps/test_dag_ti_slots_available_dep.py ..                 [ 
67%]
     tests/ti_deps/deps/test_dag_unpaused_dep.py ..                           [ 
67%]
     tests/ti_deps/deps/test_dagrun_exists_dep.py ..                          [ 
67%]
     tests/ti_deps/deps/test_mapped_task_upstream_dep.py .................... [ 
68%]
     ......................................................ssssssssssss...... [ 
70%]
     ......                                                                   [ 
71%]
     tests/ti_deps/deps/test_not_in_retry_period_dep.py ...                   [ 
71%]
     tests/ti_deps/deps/test_not_previously_skipped_dep.py .....              [ 
71%]
     tests/ti_deps/deps/test_pool_slots_available_dep.py .....                [ 
71%]
     tests/ti_deps/deps/test_prev_dagrun_dep.py ...........                   [ 
71%]
     tests/ti_deps/deps/test_ready_to_reschedule_dep.py ................      [ 
72%]
     tests/ti_deps/deps/test_runnable_exec_date_dep.py .........              [ 
72%]
     tests/ti_deps/deps/test_task_concurrency.py ..........                   [ 
73%]
     tests/ti_deps/deps/test_task_not_running_dep.py ..                       [ 
73%]
     tests/ti_deps/deps/test_trigger_rule_dep.py ............................ [ 
74%]
     ........................................................................ [ 
77%]
     ..........................                                               [ 
78%]
     tests/ti_deps/deps/test_valid_state_dep.py ...                           [ 
78%]
     tests/utils/log/test_colored_log.py .                                    [ 
78%]
     tests/utils/log/test_file_processor_handler.py ssss                      [ 
78%]
     tests/utils/log/test_json_formatter.py sssss                             [ 
78%]
     tests/utils/log/test_log_reader.py ........                              [ 
78%]
     tests/utils/log/test_secrets_masker.py sssssssssssssssssssssssssssssssss [ 
80%]
     ssssssssssssssssssssssssss                                               [ 
80%]
     tests/utils/test_cli_util.py ..................                          [ 
81%]
     tests/utils/test_context.py ....sss                                      [ 
81%]
     tests/utils/test_dag_cycle.py sssssssss                                  [ 
82%]
     tests/utils/test_dataform.py ss                                          [ 
82%]
     tests/utils/test_db.py ...................                               [ 
83%]
     tests/utils/test_db_cleanup.py ......................................... [ 
84%]
     ...                                                                      [ 
84%]
     tests/utils/test_db_manager.py ........                                  [ 
84%]
     tests/utils/test_decorators.py ssssssssssssssssssssssss                  [ 
85%]
     tests/utils/test_docs.py ssss                                            [ 
86%]
     tests/utils/test_dot_renderer.py ......                                  [ 
86%]
     tests/utils/test_edgemodifier.py ssssssssssssss                          [ 
86%]
     tests/utils/test_email.py sssssssssss..............                      [ 
87%]
     tests/utils/test_entry_points.py s                                       [ 
87%]
     tests/utils/test_event_scheduler.py s                                    [ 
87%]
     tests/utils/test_file.py ssssssssssssssssssssss                          [ 
88%]
     tests/utils/test_helpers.py .sssssssssss.ssssssssssssssssssssssssssss    [ 
90%]
     tests/utils/test_json.py sssssssssssssssss                               [ 
90%]
     tests/utils/test_log_handlers.py ...FFF.......................           [ 
91%]
   ```
   


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