shubhamraj-git opened a new pull request, #67427:
URL: https://github.com/apache/airflow/pull/67427

     The `test_execute_wait_for_termination[*-timeout]` cases were 
intermittently                                                                  
          
     failing on CI with `assert 3 == 4`.                                        
                                                                             
                                                                                
                                                                             
     ## Root cause                                                              
                                                                             
                                                                                
                                                                             
     The test used real `time.sleep(1)` with `timeout=3`, expecting 4 calls to  
                                                                             
     `get_pipeline_run`. The loop uses a strict `<` timeout check, so with exact
     1.0s sleeps you get 5 calls, and on a loaded CI runner where sleeps 
overshoot                                                                       
    
     by >0.5s you get 3 — neither is the expected 4.                            
                                                                             
                                                                                
                                                                             
     ## Fix                                                                     
                                                                             
                                                                                
                                                                             
     Patch `time.monotonic` (via `itertools.count(0.0, 1.0)`) and `time.sleep`  
                                                                             
     (no-op) in the hook module for the timeout cases. The deterministic 
sequence                                                                        
  
     0→1→2→3→4 fires the timeout check after exactly 3 iterations regardless    
                                                                             
     of system load, giving 4 total calls.                                      
                                                                             
                                                                                
                                                                             
     ---                                                                        
                                                                             
                                                                                
                                                                             
     ##### Was generative AI tooling used to co-author this PR?                 
                                                                             
      
     - [X] Yes — Claude Code (claude-sonnet-4-6)


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