Use UTC date in default flight dates test (fails locally every US evening)#106
Merged
therevoltingx merged 1 commit intoJul 15, 2026
Conversation
test_deal_uses_default_flight_dates compared local-time datetime.now() against output that request_deal.py builds with datetime.now(UTC). The test fails whenever the local date differs from the UTC date, which for US timezones is every evening from about 4pm until midnight. CI never sees it because runners are UTC. Reproduced at 20:45 PDT on 2026-07-05 (UTC date already 2026-07-06): the suite reports 1 failed, 3302 passed. With the test aligned to the UTC discipline the code under test already uses, the file's 98 tests pass at any hour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_deal_uses_default_flight_datescompares a local-time date against output the code builds in UTC, so the suite fails every evening for anyone west of UTC. One-line fix aligning the test with the code's own timezone discipline.Details
datetime.now().strftime("%Y-%m-%d")(naive local time) appears inRequestDealTooloutput.datetime.now(UTC)(src/ad_buyer/tools/buyer_deals/request_deal.py).Reproduced on a clean checkout at 20:45 PDT on 2026-07-05 (UTC date was already 2026-07-06):
This is the only naive
datetime.now()in the test suite (grep confirms).Verification
After the change, all 98 tests in the file pass regardless of local timezone;
ruff checkandruff format --checkclean.