Skip to content

test: timezone information was dropped when parsing the cancel NotifyEnd#261

Merged
epmog merged 1 commit intoOpenJobDescription:mainlinefrom
epmog:fix_timezone_in_notify
Aug 21, 2025
Merged

test: timezone information was dropped when parsing the cancel NotifyEnd#261
epmog merged 1 commit intoOpenJobDescription:mainlinefrom
epmog:fix_timezone_in_notify

Conversation

@epmog
Copy link
Contributor

@epmog epmog commented Aug 21, 2025

What was the problem/requirement? (What/Why)

1 test was failing locally for me on my macOS machine - test_cancel_notify.

FAILED test/openjd/sessions/test_runner_base.py::TestScriptRunnerBase::test_cancel_notify - assert datetime.timedelta(seconds=18001, microseconds=361076) < datetime.timedelta(seconds=3)

hint: 18000seconds is 5 hours or GMT-5

At first i thought there was some nuance in datetimes on macOS vs. other OSes. But it turns out that this fails on Windows too if the timezone for the machine isn't UTC.

What was the solution? (How)

We were dropping the timezone information ('Z') from the cancel notify file and so python was interpreting it as the local time before then changing to UTC. Didn't discover this previously since all of our runners are on UTC.

What is the impact of this change?

All non-cross-user tests run locally on macOS (and other OSes if you're not in UTC)!

How was this change tested?

hatch run test
...
==== 472 passed, 26 skipped, 15 xfailed in 44.25s ====

Was this change documented?

N/A

Is this a breaking change?

No

Does this change impact security?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@epmog epmog requested a review from a team as a code owner August 21, 2025 16:32
lucaseck
lucaseck previously approved these changes Aug 21, 2025
Signed-off-by: Morgan Epp <60796713+epmog@users.noreply.github.com>
@sonarqubecloud
Copy link

@epmog epmog enabled auto-merge (squash) August 21, 2025 17:10
@epmog epmog merged commit 6de1e73 into OpenJobDescription:mainline Aug 21, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants