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

IPython test timeout #95

Open
bedroge opened this issue Apr 17, 2021 · 2 comments
Open

IPython test timeout #95

bedroge opened this issue Apr 17, 2021 · 2 comments

Comments

@bedroge
Copy link
Collaborator

bedroge commented Apr 17, 2021

I've seen the following error a few times during the test step of installing IPython:

======================================================================
FAIL: test_aimport_module_completer (IPython.core.tests.test_completer.TestCompleter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/cvmfs/pilot.eessi-hpc.org/2021.03/software/linux/aarch64/graviton2/software/IPython/7.15.0-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/IPython/core/tests/test_completer.py", line 1057, in test_aimport_module_completer
    nt.assert_in("io", matches)
AssertionError: 'io' not found in []
-------------------- >> begin captured stdout << ---------------------
Caching the list of root modules, please wait!
(This will only be done once - type '%rehashx' to reset cache!)
This is taking too long, we give up.
--------------------- >> end captured stdout << ----------------------
    """Fail immediately, with the given message."""
>>  raise self.failureException("'io' not found in []")

This is the actual test:

    def test_aimport_module_completer(self):
        ip = get_ipython()
        _, matches = ip.complete("i", "%aimport i")
        nt.assert_in("io", matches)
        nt.assert_not_in("int", matches)

Apparently, something is taking too long (slow I/O?) and causing a timeout. In all cases I was able to "solve" it by just redoing the installation.

@ocaisa
Copy link
Member

ocaisa commented Apr 19, 2021

In this case, you were building IPython on top of an existing CVMFS stack and I think that IPython is querying the available python modules. CVMFS needs to first pull them into the cache, this is probably taking too long for IPythons liking and it thinks that something is up. That's why I think it works the second time around since the Python installation is already cached then.

@bedroge
Copy link
Collaborator Author

bedroge commented Apr 19, 2021

Yes, that probably makes sense.

I think the actual issue was here:
https://github.com/ipython/ipython/blob/master/IPython/core/completerlib.py#L141

And this timeout value is defined here:
https://github.com/ipython/ipython/blob/master/IPython/core/completerlib.py#L52

I'm not sure if you can easily change it. There is a timeout scale factor for the tests:
https://github.com/ipython/ipython/blob/master/IPython/testing/__init__.py#L44
But, although they say they scale all timeouts via this factor, I don't see anywhere in the code that this also applies to the TIMEOUT_GIVEUP. Could be worth trying, though it's a bit hard to test this...

trz42 pushed a commit to trz42/software-layer that referenced this issue Apr 21, 2023
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

No branches or pull requests

2 participants