EnxDev opened a new pull request, #44651:
URL: https://github.com/apache/superset/pull/44651

   ### SUMMARY
   
   `test_stale_retry_recovers_at_max_delay[*-sqlite-3599-False]` fails 
intermittently in CI, for example on #44650 
([run](https://github.com/apache/superset/actions/runs/36124762115/job/108038435709)):
   
   ```
   AssertionError: assert (ExecutionClaim(initial_state='Retrying') is not 
None) is False
   ```
   
   The test builds `last_eval_dttm` from `utc_now().replace(microsecond=0)`, 
which can be up to a second behind the real clock. `_claim_execution` then 
measures the row's age with `datetime.utcnow()`. The effective age of the "3599 
seconds" case is therefore 3599 s, plus the dropped fraction, plus however long 
the test takes. On a slow runner that reaches the 3600 s delay, the claim goes 
through, and the test fails.
   
   The fix freezes the clock at the test's timestamp for the test body, so both 
sides read the same time. Only the test changes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A
   
   ### TESTING INSTRUCTIONS
   
   ```
   pytest tests/unit_tests/commands/report/execution_claim_test.py
   ```
   
   To reproduce the flake, add `time.sleep(1.1)` just before the 
`claim_execution(...)` call in the test. On master the two `3599-False` cases 
fail with the CI error above. With this change they still pass.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to