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
Leap second tests fail if system clock is in the future (2021-06-04) #10228
Comments
|
https://github.com/astropy/astropy/blob/master/astropy/utils/iers/tests/data/leap-seconds.list#L208 Maybe the test should not use the current time. |
|
@bmwiedemann - thanks for your message! As @pllim notices, it is not possible to predict how the earth's rotation evolves in the future, and hence the failures you are seeing are real: by that time, we cannot guarantee some parts of |
|
In openSUSE, we build without network-access to ensure that all required data comes from the build system. I think, the best route is to always use a 2019 date instead of Time.now() for such a failing test, because future leap seconds cannot be predicted, but 2019 dates should still be working in 2035. |
|
@bmwiedemann - usually there is a specific reason to use |
When running the tests with At least some data sources are indeed defined locally in |
But we would need to make sure we notice if those files becomes stale during the dev process. I agree that it makes sense to ignore them during third party packaging tests. |
|
|
I'm confused, is |
|
More generally: it is probably good to assume any non- |
|
Here is a log of the failing 2021-06-04 build test |
I may have attributed that to the wrong test; with |
|
test_fake_expired_file should probably remain? |
|
@bmwiedemann - thanks so much for sharing! This not even reaching testing we definitely need to fix! It reminds me that there is a real problem with which I only seem able to solve by removing |
|
Re: pytest.PytestDeprecationWarning -- That is caused by astropy/pytest-doctestplus#94 and is fixed by astropy/pytest-doctestplus#103 |
|
yes, please downgrade pytest to <5.4 for now. I'll do a pytest-doctestplus release very soon, that will have this resolved. |
|
@bmwiedemann can you get at least the test collection to succeed by adding |
|
This patch makes it pass in 2021, but not 2035 (see 2nd partial backtrace in original message) --- astropy-4.0.1.post1.orig/setup.cfg
+++ astropy-4.0.1.post1/setup.cfg
@@ -107,6 +107,7 @@ xfail_strict = true
qt_no_exception_capture = 1
filterwarnings =
error
+ ignore:leap-second file is expired.
ignore:unclosed file:ResourceWarning
ignore:unclosed <socket:ResourceWarning
ignore:unclosed <ssl.SSLSocket:ResourceWarningMy python-foo is not sufficient for pytest adjustment, |
|
@bmwiedemann that partial backtrace looks incomplete. The actual Exception is missing. Could you post the full buildlog or provide a link to the OBS repo? |
|
@bnavigator https://build.opensuse.org/package/show/openSUSE:Factory/python-astropy is the OBS package And to build in the future, you can use |
|
@bmwiedemann the openSUSE package switched to "multibuild" a month ago. So the python-astropy rpm package gets built independently of the unit test runs. Is it still crucial for reproducible builds to also pass the My branch, where I started to fix the currently failing tests: Edit: Above branched package python-astropy:tests now builds for present and future dates. |
|
The fail in 2034 is because of some functions reporting it as "dubious year": And I thought 2020 is already a dubious year |
|
Ah, I just retested it and it now passes fine with the tests split off via _multibuild. |
|
So the python-astropy:test package does not need to be reproducible? (Edit: Doesn't matter. The fix by ignoring the relevant warning messages is on its way into openSUSE:Factory) |
|
I'll defer to @mhvk on this one. Re-reading his response in #10228 (comment) , I feel like we can close this but I am not 100% sure. |
|
Indeed, it would seem that the failures were "real" in that they would correctly warn that the code was not reliable for the "present time". So, let's close this. But please do not hesitate to open another issue; I very much appreciate the reproducible build efforts!! |
|
|
|
@bmwiedemann does this warning prevent any package to build reproducibly? python-gwpy in openSUSE is at 2.1.5, there is an upstream update available. @badshah400 is the maintainer. One could always add another ignore to the filterwarnings. |
|
Hello, is this still a problem or has this been fixed up/down-stream? |
Description
As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future.
The usual offset is +15 years, because that is how long I expect some software will be used in some places.
This showed up failing tests in our python-astropy package build.
See https://reproducible-builds.org/ for why this matters.
Expected behavior
Software should be able to build anytime.
Actual behavior
tests fail with
That check already fails before 2021-06-04
and when dropping that expiry check, there is another problem with
Time.now()Steps to Reproduce
py.test-3.8System Details
Linux-5.6.6-1-default-x86_64-with-glibc2.2.5
Python 3.8.2 (default, Mar 05 2020, 18:58:42) [GCC]
Numpy 1.18.3
astropy 4.0.1.post1
Scipy 1.4.1
The text was updated successfully, but these errors were encountered: