teuthology-node-cleanup: use same timezone as local - #2079
Open
kshtsk wants to merge 1 commit into
Open
Conversation
kshtsk
requested review from
VallariAg and
amathuria
and removed request for
a team
August 28, 2025 15:06
kshtsk
force-pushed
the
wip-respect-local-tz
branch
from
August 28, 2025 15:07
0aff8fb to
4ab4197
Compare
kshtsk
force-pushed
the
wip-respect-local-tz
branch
from
September 3, 2025 17:04
4ab4197 to
0b8b93e
Compare
Fixes: https://tracker.ceph.com/issues/72773 Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
kshtsk
force-pushed
the
wip-respect-local-tz
branch
from
September 9, 2025 19:34
6930aeb to
5a72896
Compare
zmc
requested changes
Dec 3, 2025
zmc
left a comment
Member
There was a problem hiding this comment.
On main:
>>> now = datetime.datetime.now(datetime.timezone.utc)
>>> now
datetime.datetime(2025, 12, 3, 18, 40, 4, 927253, tzinfo=datetime.timezone.utc)
>>> tzhere = now.astimezone().tzinfo
>>> job_updated = '2025-12-03 18:00:00'
>>> delta = now - parse_timestamp(job_updated)
>>> delta.total_seconds() / 3600
0.6680353480555555
With these changes:
>>> now = datetime.datetime.now(datetime.timezone.utc)
>>> now
datetime.datetime(2025, 12, 3, 18, 39, 28, 578278, tzinfo=datetime.timezone.utc)
>>> tzhere = now.astimezone().tzinfo
>>> job_updated = '2025-12-03 18:00:00'
>>> delta = now - parse_timestamp(job_updated, tzhere)
>>> delta.total_seconds() / 3600
-6.3420615894444445
This would cause significant problems in sepia (where everything is UTC). I suggest we do all calculations using UTC.
Contributor
Author
I guess you're doing it on your laptop, which is in East Pacific? Here what I have running on UTC, teuthology.front: |
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.
Fixes: https://tracker.ceph.com/issues/72773