DanRoscigno opened a new pull request, #42818: URL: https://github.com/apache/superset/pull/42818
### SUMMARY `TestValidateTimeRangeSubDayLast::test_sub_day_last_normalizes` opens with a premise assertion — that the raw value really does blow up in `get_since_until()` — before checking that `validate_time_range()` rewrites it into an explicit `DATEADD` range. For the bare `"Last hour"` and `"Last Hour"` cases that premise depends on the wall time. parsedatetime resolves a bare `"Last hour"` to the top of the previous hour, not to `now - 1h`. `get_since_until()` pairs it with a default until of `today` (midnight), so: - at 14:25 → since `13:00`, which is after midnight → raises, test passes - at 01:25 → since `00:00`, which *equals* the until → does not raise, test fails - at 00:25 → since `23:00` the previous day, before the until → does not raise, test fails So the case fails whenever CI happens to run between 00:00 and 01:59 in the runner's local time, and passes the other 22 hours. It surfaced on [#42628](https://github.com/apache/superset/pull/42628), whose `unit-tests (current)` job started at 01:16 UTC; that PR touches only `superset/mcp_service/chart/schemas.py`, so the failure is unrelated to it. Only the premise assertion is time-sensitive. `validate_time_range()` itself is pure string rewriting and is correct at any hour, so this is a test defect, not a product one. Freezing the clock at midday makes every parametrized case exercise the same relationship. ### TESTING INSTRUCTIONS ```bash pytest tests/unit_tests/mcp_service/common/test_time_range_validation.py ``` To see the original failure, run the suite with the clock frozen inside the bad window — an autouse `freeze_time("2026-08-05 01:25:00")` fixture reproduces exactly the two failing parametrizations on master, and none on this branch. I confirmed all 75 cases pass at 00:25, 01:25, 02:25, 12:25 and 23:25. ### 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]
