-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify UTC timezone argument in datetime.now() and fix unit tests #6279
Conversation
I wonder if you can now remove the xfail here?
|
Removed the
|
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
For some reason, the |
#6312) …tests (#6279)" This reverts commit 7577534. Surprisingly, the commit runs fine locally and even in the CI but I am seeing these failures: - https://github.com/getsentry/snuba/actions/runs/10893514288/job/30228865217 - https://github.com/getsentry/snuba/actions/runs/10894057864/job/30230460999 Reverting this commit to unblock deploy-snuba-s4s.
During the investigation of #6279, I found that: - `OPTIMIZE_JOB_CUTOFF_TIME` is overridden to `24` and it was causing test failures. - `OPTIMIZE_PARALLEL_MAX_JITTER_MINUTES` does not seem to be used anywhere in the code. With the change, less no. of local tests fail. The failure number is non-zero because #6279 was reverted yesterday . I would like to verify if this small change passes through the CI and stays stable in prod.
While running unit tests locally using
make test
, I saw these failures:The reason for failure is that some of these tests use time_machine's context manager, which expects the time in UTC. When these tests are run locally in PST, there is a difference of 7 hours that never triggers the cutoff time expiry.
The fix is to use
datetime
'stimezone.utc
instead ofdatetime.now()
.Datetime
also used to havedatetime.utcnow()
but it has been deprecated.Note: I also fixed some non-test code, so I would appreciate reviews from experts in those areas.