You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/09/23 22:38:05 UTC

[PR] fix(reports): freeze time in the stale-retry boundary test to stop a CI race [superset]

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): freeze time in the stale-retry boundary test to stop a CI race [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber closed pull request #44586: fix(reports): freeze time in the stale-retry boundary test to stop a CI race
URL: https://github.com/apache/superset/pull/44586


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): freeze time in the stale-retry boundary test to stop a CI race [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber commented on PR #44586:
URL: https://github.com/apache/superset/pull/44586#issuecomment-5852343704

   This was fixed in https://github.com/apache/superset/issues/44651 so I'll be closing this PR off. If anything, this one has more comments :D


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): freeze time in the stale-retry boundary test to stop a CI race [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44586:
URL: https://github.com/apache/superset/pull/44586#issuecomment-5804113284

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(reports): freeze time in the stale-retry boundary test to stop a CI race [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44586:
URL: https://github.com/apache/superset/pull/44586#issuecomment-5804362610

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44586?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 77.49%. Comparing base ([`390bf29`](https://app.codecov.io/gh/apache/superset/commit/390bf299ff98c47dfa2909037e9c26897d1557ee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e216123`](https://app.codecov.io/gh/apache/superset/commit/e216123f7737b42363c43b8b20c940e592bd5266?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #44586      +/-   ##
   ==========================================
   - Coverage   81.06%   77.49%   -3.58%     
   ==========================================
     Files        2955     2955              
     Lines      178325   178325              
     Branches    41312    41312              
   ==========================================
   - Hits       144558   138189    -6369     
   - Misses      31054    37288    +6234     
   - Partials     2713     2848     +135     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.79% <ø> (ø)` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.69% <ø> (ø)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.47% <ø> (-6.90%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/44586/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.64% <ø> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44586?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org