GH-41605: [C++][Gandiva] Stabilize TestFromUtcTimestamp around DST boundary#49887
Open
Reranko05 wants to merge 1 commit intoapache:mainfrom
Open
GH-41605: [C++][Gandiva] Stabilize TestFromUtcTimestamp around DST boundary#49887Reranko05 wants to merge 1 commit intoapache:mainfrom
Reranko05 wants to merge 1 commit intoapache:mainfrom
Conversation
|
|
Contributor
|
I think this is ok, but I would consider adding a comment in the test code about the fragility around DST times. An alternative my AI assistant proposed is using timegm instead of mktime and then you can also remove the Hack in Epoch(). The only trick is that windows needs a timegm definition, like this: #ifdef _WIN32 / #define timegm _mkgmtime Apparently some implementations of mktime account for DST and others dont. That approach might be worth trying out locally to see if it fixes the failing test. #49902 |
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.
Rationale for this change
The existing test includes a timestamp that falls on a DST spring-forward boundary, which can make the expected result environment-dependent. This change avoids that boundary to make the test deterministic across environments.
What changes are included in this PR?
Adjusted the DST-sensitive test input in
TestFromUtcTimestampUpdated the corresponding expected output
Are these changes tested?
Are there any user-facing changes?
No