Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test failures on systems with 32-bit time_t #177

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Feb 29, 2024

Fixes #176

Changes proposed in this pull request:

  • Change the frozen date from 2020 to 2010, in order to avoid going past 2038 that breaks systems with 32-bit time_t. Since the tests are run against frozen time anyway, this shouldn't have any negative consequences, and will resolve the y2k38 issue that's not really related to the project.

Change the frozen date in test_time from 2020 to 2010, in order to fix
overflow when processing "27 years from now" date on systems with 32-bit
time_t.  Since the date is arbitrary and frozen anyway, this seems to be
the cleanest solution to keep the test suite working portably.

Fixes python-humanize#176
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.20%. Comparing base (218a86e) to head (2858f21).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #177   +/-   ##
=======================================
  Coverage   99.19%   99.20%           
=======================================
  Files           9        9           
  Lines         749      750    +1     
=======================================
+ Hits          743      744    +1     
  Misses          6        6           
Flag Coverage Δ
macos-latest 97.60% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 97.60% <100.00%> (+<0.01%) ⬆️
windows-latest 96.13% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hugovk hugovk added the changelog: Fixed For any bug fixes label Feb 29, 2024
tests/test_time.py Outdated Show resolved Hide resolved
tests/test_time.py Show resolved Hide resolved
@hugovk hugovk enabled auto-merge (squash) March 1, 2024 06:31
@hugovk
Copy link
Member

hugovk commented Mar 1, 2024

Thank you!

@hugovk hugovk merged commit ff11540 into python-humanize:main Mar 1, 2024
30 checks passed
@mgorny mgorny deleted the 2k38 branch March 1, 2024 17:01
@mgorny
Copy link
Contributor Author

mgorny commented Mar 1, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Fixed For any bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"27 years from now" tests fail on platforms with 32-bit time_t (y2k38 problem)
2 participants