-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Some tests failling in astropy-0.3.1 #2168
Comments
Is there a way to attach a file? |
@sergiopasra - you can create a gist with your file. AFAIK there are no file attachments. |
This is the output of astropy.test() with numpy from RPM And this is the output with numpy from virtualenv. http://guaix.fis.ucm.es/~spr/github/astropy_venv-python276-numpy180.txt No difference between them. |
Odd. I've never seen any of those tests fail in any of those ways. Just created a fresh virtualenv with fresh installs of Numpy 1.8 and Astropy 0.3.1 from pip and did not encounter any problems:
Are you running As you can see I am running Python 2.7.3. I will try to make a 2.7.6 build and see if that reproduces the issue. If so this would have to be an odd Python bug :/ |
Nope, don't get any failures with Python 2.7.6 :/
|
Two differences I see between our test runs is that I have |
I'm going to try building with UCS-4 and see if that makes a difference. |
Nope, that didn't make any difference either. Nor should it have, for any reason I could think of. But I'm grasping at straws here....
|
I did 'python -c 'import astropy; astropy.test()' under 'build'. I have compiled python 2.7.6 from source code and I'm not seeing any errors. This has to be related with Fedora's patches to python or perhaps the handling of temporary files. |
Could you point me to this patches? I can see if that makes any difference. |
So now I have compiled python 2.7.6 in my virtual machine and the tests fails again! The situation is So it is not related with the Fedora's patches to python, is something else. In Fedora 21 Running tests with Astropy version 0.3.1. Platform: Linux-3.14.0-0.rc5.git0.1.fc21.1.x86_64-x86_64-with-fedora-21-Rawhide Executable: /home/spr/ap2/bin/python Full Python Version: encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 15 Numpy: 1.8.0 collected 58 items astropy/io/fits/tests/test_table.py ........................................................F. =================================== FAILURES =================================== In Fedora 20 ============================= test session starts ============================== Running tests with Astropy version 0.3.1. Platform: Linux-3.13.5-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug Executable: /home/spr/devel/ap2/bin/python Full Python Version: encodings: sys: ascii, locale: UTF-8, filesystem: UTF-8, unicode bits: 15 Numpy: 1.8.0 collected 58 items astropy/io/fits/tests/test_table.py .......................................................... ========================== 58 passed in 1.63 seconds =========================== |
I find it amusing, particularly in this case, that Fedora 20 is code-named "Heisenbug" |
So you just now used a Python compiled from source that did not use any of Fedora's patches? |
That's correct. I have compiled the python 2.7.6 tarball from python.org in my virt machine and my workstation. In my workstation with F20 the tests pass and in my virtual machine with F21 they do not. So I'm using the same Python without any patch in both systems |
Part of the Fedora community considered naming useless, so there will be no more names for releases :( |
Is there anyone else with a Fedora 21 installation who can confirm this? |
I'm installing in a VM to see for myself. Too bad about the naming thing--some people hate fun...even more than I do apparently ;) |
I have a somehow reduced test case that fails in F21 and passes in F20. It writes down the FITS files to disk. |
Some of the test FITS files produced by the previous test case are different in both systems. |
Opening both files with fv, the one in F20 has 3 extensions, that in F21 has only 1 |
Thanks for whittling it down. Should be helpful. I'm still waiting for this VM to finish installing. It is still truly mysterious. |
@embray Any progress with this? I have found a possible source of error. If I run this code
I get
in Fedora 20 and
in Fedora 21, the 'append' mode does not work correctly |
I haven't had a chance yet to get back to this but I'm hoping to soon. I do have a Fedora 21 VM set up so I can test this, and your test code will help. This definitely sounds like a behavior of 'append', which does open the underlying file with append mode. This should have a well-defined behavior, and yet many platforms do wonky things with append mode. I have to wonder if there's a bug somewhere in this version of Fedora though it would seem pretty weird. |
In particular, when you opened a FITS file with |
Okay, I was able to reproduce this, and it's more or less as I expected--seek isn't working on files opened in "Note that if the file is opened for appending (mode 'a' or 'a+'), any seek() operations will be undone at the next write. If the file is only opened for writing in append mode (mode 'a'), this method is essentially a no-op, but it remains useful for files opened in append mode with reading enabled (mode 'a+')." But in this case, even though the file is opened 'ab+' (it should be the same for a+ or ab+, and I confirmed this) seeking isn't working and is essentially being treated as a no-op. The question remains, is this a problem in Python on Fedora, or is it something deeper? |
Uh oh, this is what I was afraid of:
This is not the behavior I see on any other platform I just tested this on. On most platforms (except Windows, which I knew, and I believe possibly FreeBSD but I haven't tried) the file pointer starts at 0 upon opening the file, and doesn't jump to the end until a write is performed. That difference is okay because PyFITS already accounts for it. The difference is that on those other platforms the explicit seek to the beginning of the file works, and on here it doesn't. Could there have been a change in the libc between Fedora versions? Could this be intentional? It sounds like a bug to me but I'm not sure. |
LOL, right here reported 2 days ago: https://sourceware.org/bugzilla/show_bug.cgi?id=16724 |
I'm not sure there's much more I can do with this, given that it's a bug in glibc. Since Fedora 21 final isn't released yet I will probably leave this as is and not try to find a workaround. The reporter of the issue mentioned that a patch is coming so presumably it will be fixed before then. |
That's a good one! I'm surprised there's so little chatter in that bug report -- I would have assumed this affected a lot of things. |
I don't know that the "a+" mode is really used by a lot of applications. |
This is supposed to be fixed in Fedora Rawhide https://bugzilla.redhat.com/show_bug.cgi?id=1078355 The relevant build of glibc is this: http://koji.fedoraproject.org/koji/buildinfo?buildID=505664 @embray Thank you for the research! I couldn't imagine this would be a bug in glibc |
I have checked that with the new glibc the problem disappears. I'm closing the issue |
Excellent, thanks! |
Hi, prior to updating the Fedora package, I have tested astropy-0.3.1 in the development version of Fedora and I'm seeing some failures in the tests.
I have python 2.7.6 and numpy 1.8.0. I have tried both the prepackaged version of numpy and via pip in a virtualenv and I get the same errors.
Strangely enough I'm not getting errors in Fedora 20 with python 2.7.5 and numpy 1.8.0
The errors are in
astropy.io.fits.tests.test_image.TestImageFunctions.test_io_manipulation
astropy.io.fits.tests.test_structured.TestStructured.test_structured
astropy.io.fits.tests.test_table.TestTableFunctions.test_copy_vla
The text was updated successfully, but these errors were encountered: