EESSI / software-layer

Software layer of the EESSI project
https://eessi.github.io/docs/software_layer
GNU General Public License v2.0
24 stars 48 forks source link

IPython test timeout #95

Open bedroge opened 3 years ago

bedroge commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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...