Skip to content

GH-41605: [C++][Gandiva] Stabilize TestFromUtcTimestamp around DST boundary#49887

Open
Reranko05 wants to merge 1 commit intoapache:mainfrom
Reranko05:41605-datetimetest
Open

GH-41605: [C++][Gandiva] Stabilize TestFromUtcTimestamp around DST boundary#49887
Reranko05 wants to merge 1 commit intoapache:mainfrom
Reranko05:41605-datetimetest

Conversation

@Reranko05
Copy link
Copy Markdown
Contributor

@Reranko05 Reranko05 commented Apr 28, 2026

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 TestFromUtcTimestamp
Updated the corresponding expected output

Are these changes tested?

  • Reproduced the original failure locally
  • Re-ran the modified test successfully

Are there any user-facing changes?

No

@github-actions
Copy link
Copy Markdown

⚠️ GitHub issue #41605 has been automatically assigned in GitHub to PR creator.

@lriggs
Copy link
Copy Markdown
Contributor

lriggs commented Apr 30, 2026

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

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.

2 participants