GH-50399: [C++][Gandiva] Use timegm in DaysSince helper in Gandiva date_time_test#50400
Conversation
|
@Reranko05 @lriggs would either of you want to look at this PR? |
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent timezone handling in Gandiva’s datetime test utilities by switching the DaysSince() helper from mktime() (local time) to timegm() (UTC), aligning it with Epoch() and other helpers so date/time comparisons are stable across platforms and DST settings.
Changes:
- Updated
DaysSince()to usetimegm()instead ofmktime(). - Updated the fatal log message to match the new helper (
timegm() failed).
|
|
|
Thanks for looking @Reranko05 and @lriggs. Let's get at least one committer/PMC review and then I'll merge. |
|
Thanks @adamreeve! |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6096d41. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 6096d41. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Rationale for this change
DateTimeTestProjector.TestDateTime fails for me locally and it looks like the issue is that it's comparing datetimes calculated with two different methods:
What changes are included in this PR?
Updated DaysSince() helper to use timegm to match other helpers so comparisons can be made without local time one handling issues.
Are these changes tested?
Yes. The test that fails locally now passes locally with this.
Are there any user-facing changes?
No.