Skip to content

CI: add pypy #10051

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

Closed
wants to merge 5 commits into from
Closed

CI: add pypy #10051

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 18, 2017

This PR adds pypy to the test matrix. It is marked as a failure for now, but will allow measurement of the pypy progress.

@eric-wieser
Copy link
Member

@mattip seemed to suggest that #10042 fixes the pypy tests, but maybe I misunderstood that.

@ghost
Copy link
Author

ghost commented Nov 19, 2017

IMO this should just be merged since it doesn't actually change any code and allows reviewers to see the results of the pypy tests. #10042 isn't merged yet, so the pypy tests would tend to fail (I can't personally vouch for that PR though).

@eric-wieser
Copy link
Member

eric-wieser commented Nov 19, 2017

Is there any way to make that test give more useful output? There's not much I can do to track down the problem in this output

nose version 1.3.7
.......................E....E................S.............................................................................................................................................S.................................E.................S..................................................................................................................................E..............................................................................KKK.EE.EEE.EEEE.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................KK.........................E........S.......................................................F..................................................................................................................................................................................................................................................................................RPython traceback:
  File "pypy_module_pypyjit.c", line 183, in portal_12
  File "pypy_interpreter_2.c", line 35363, in handle_bytecode__AccessDirect_None
  File "pypy_interpreter_2.c", line 46582, in dispatch_bytecode__AccessDirect_None
*** Invalid usage of a dying CPython object ***
cpyext, the emulation layer, detected that while it is calling
an object's tp_dealloc, the C code calls back a function that
tries to recreate the PyPy version of the object.  Usually it
means that tp_dealloc calls some general PyXxx() API.  It is
a dangerous and potentially buggy thing to do: even in CPython
the PyXxx() function could, in theory, cause a reference to the
object to be taken and stored somewhere, for an amount of time
exceeding tp_dealloc itself.  Afterwards, the object will be
freed, making that reference point to garbage.
>>> PyPy could contain some workaround to still work if
you are lucky, but it is not done so far; better fix the bug in
the CPython extension.
./tools/travis-test.sh: line 105:  6158 Aborted                 (core dumped) $PYTHON ../tools/test-installed-numpy.py --mode=full

Perhaps run the tests in verbose mode or something so that the actual test names print out?

@ghost
Copy link
Author

ghost commented Nov 19, 2017

That test failure appears to be non-deterministic because I couldn't see it in the last test run. Running the tests in verbose mode is an option but not sure that should be done on the CI. Do you want verbose mode for pypy only?

@eric-wieser
Copy link
Member

Ooh, another approach would be to just enable faulthandler in the tests, assuming that PyPy has that. That would be generally useful on all test setups.

@eric-wieser
Copy link
Member

Beat me to it, was about to link to nose-faulthandler!

@njsmith
Copy link
Member

njsmith commented Nov 19, 2017 via email

@eric-wieser
Copy link
Member

Note that the faulthandler module is only available on python 3, so I think nose-faulthandler needs to be installed conditionally

@ghost
Copy link
Author

ghost commented Nov 19, 2017

That's not the problem. nose-faulthandler should always be installed, but it's triggering a dependency.

@ghost
Copy link
Author

ghost commented Nov 19, 2017

@larsoner Please update nose-faulthandler on pypi. In the mean time, I will work around the problem.

@eric-wieser
Copy link
Member

Hmm, now it seems to hang

@ghost
Copy link
Author

ghost commented Nov 19, 2017

Do you want to disable faulthandler then?

@ghost
Copy link
Author

ghost commented Nov 19, 2017

Don't look now, but it might be unhung.

@eric-wieser
Copy link
Member

faulthandler seems pretty handy for all the other modes, so I'd be inclined to keep that.

Maybe we should not run the full tests for pypy yet, if that's what's causing it to be slow? Having tests take longer to complete is a pain, and it seems travis won't mark the job as complete even if all the required tests pass.

@ghost
Copy link
Author

ghost commented Nov 19, 2017

No, the fact is that pypy is slow for running tests. We could skip it for PRs. Would you prefer that?

@mattip
Copy link
Member

mattip commented Nov 19, 2017

I should be the last one to criticize, but:

@ghost
Copy link
Author

ghost commented Nov 19, 2017

Travis is running an old version of PyPy, 5.8.0 which is considered "old". Version 5.9.0 released in October fixes many issues related to running pandas and numpy. Is there a way to make travis use the latest released PyPy like the portable one (runs on most versions of linux) available here?

File an issue with Travis CI.

PyPy3 is still beta-quality, for instance virtualenv does not install on it yet

It passes most of the tests, and I think it should pass nearly all of them when nditer is merged. The goal is to discover bugs in the tests. If it's more likely to fail, that's good.

@ghost
Copy link
Author

ghost commented Nov 19, 2017

I don't see this being merged though due to the timing issue.

@ghost ghost closed this Nov 19, 2017
@ghost ghost deleted the patch-1 branch November 19, 2017 05:35
@njsmith
Copy link
Member

njsmith commented Nov 19, 2017

FTR, there's an example here of fetching and setting up the latest pypy3 release in a travis build script: https://github.com/python-trio/trio/blob/3edfafeedef4071646a9015e28be01f83dc02f94/ci/travis.sh#L52-L62

@mattip not sure what you mean about virtualenv not working on pypy3, you can see in the snippet above that I've been using it for months...

@ghost
Copy link
Author

ghost commented Nov 19, 2017

@njsmith Just to be clear, I closed this because people are not going to tolerate pypy taking 30 minutes to finish the tests. That's not unique to numpy; every project that I've seen takes at least two times as long to test.

@mattip
Copy link
Member

mattip commented Nov 19, 2017

@njsmith virtualenv fails on our 32 bit linux chdir buildbot which uses Ubuntu 12.04, and this travis build also fails.

@njsmith
Copy link
Member

njsmith commented Nov 19, 2017

@xoviat ah, true, that's a discussion we'll probably need to have at some point. 30 minutes seems excessive when most of our tests runs are ~5 minutes -- though I guess you have it running all the slow tests too? The next pypy release should have speedups for cpyext calls that might make a significant difference... or not. Another trick that can be useful is to convince Travis to kick off the pypy run first, since the travis run limit means we're doing 2-3 separate passes to get all the other tests finished.

@mattip ah weird -- it's been fine for me on travis's 64-bit 14.04. Not sure what's going on with that travis build -- the error messages are about cython?

@mattip
Copy link
Member

mattip commented Nov 19, 2017

You need to open the install step. This is the correct link to failing virtualenv

@njsmith
Copy link
Member

njsmith commented Nov 19, 2017

@mattip Huh, lots of weird stuff going on there. That's using a pinned old version of virtualenv -- could that be the problem? I wonder if we even still need to do that. And then why doesn't our script notice when the virtualenv call fails. And why do we then pip install -U virtualenv after we've already set up a virtualenv using an old version...

@larsoner
Copy link
Contributor

Please update nose-faulthandler on pypi.

In principle this is possible. nose itself is unmaintained, though, so I am disinclined to maintain the plugin for it. Installing from GitHub should be doable with pip, though, and it sounds like you got to that solution anyway.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants