rusackas opened a new pull request, #44586: URL: https://github.com/apache/superset/pull/44586
### SUMMARY `test_stale_retry_recovers_at_max_delay` intermittently fails on `master`'s Python-Unit CI, most recently as `test_stale_retry_recovers_at_max_delay[Alert-sqlite-3599-False]`. The test asserts on either side of the 3600s stale-retry threshold: `age=3599` should still be within the window (not eligible for reclaim), `age=3601` should be past it (eligible). It captures `now` once and derives `last_eval_dttm` from it, but `claim_execution` → `_claim_execution` (`superset/commands/report/execution_claim.py:172`) compares that against a **fresh** `datetime.utcnow()` call internally, not the `now` the test passed in. Sitting exactly 1 second inside the boundary, any real delay between the test's setup and that internal check — plausible under a loaded CI run with `pytest -n auto` — pushes the effective age past 3600s and flips the assertion. This is a test-only fix: `datetime.utcnow()` inside `_claim_execution` is the correct production behavior (staleness has to be measured against real wall-clock time, not a caller-supplied value), so the fix freezes time for the test instead of changing what the code compares against. ### TESTING INSTRUCTIONS ``` pytest tests/unit_tests/commands/report/execution_claim_test.py -k test_stale_retry_recovers_at_max_delay -v ``` All 4 non-skipped parametrizations pass locally, including the exact case that flaked in CI (`Alert-sqlite-3599-False`). ### 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]
