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

Travis tests do not quit cleanly under linux. #1196

Closed
BoPeng opened this issue Jan 29, 2019 · 9 comments
Closed

Travis tests do not quit cleanly under linux. #1196

BoPeng opened this issue Jan 29, 2019 · 9 comments
Labels

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Jan 29, 2019

I have spent long hours trying to figure out why travis tests do not quit cleanly under travis. It seems to boils down to test_execute.py and removing one test seemed to work but there is nothing suspicious about this test.

I suspected zombie processes and wraps the tests under check_zombie.py but this does not seems to be a problem either. Perhaps we will have to log in to travis or get a test docker image to figure out the reason.

@gaow
Copy link
Member

gaow commented Jan 29, 2019

Indeed, what's special about this workflow in question? Is there another simpler test for executing ipynb files? Can it be some dependency issues parsing ipynb files?

Also current build still seems to fail even though all tests pass? Is that the warning messages causing it? For the warning message,

    from collections import Sequence, Mapping, Set

should now be

    from collections.abc import Sequence, Mapping, Set

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

I created a branch and add remove tests. Removing that test fixed the hanging issue but removing some other tests could also stop hanging. The warnings you mentioned appear also in successful test runs so are unlikely to be the culprit.

The only sensible way to debug is to login to Travis, which we will have to contact Travis support ...

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

Per https://docs.travis-ci.com/user/running-build-in-debug-mode/, I just emailed travis tech support.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

testSetVariablesTo_Output is confirmed to single-handedly trigger the hang, but the test hangs after removing this test, so there are more.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

This test does not fail under windows using native python 3.6, but fails under anaconda python 3.7.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

OK, it is confirmed. The failure comes from the python module pytest-cov, which is a module for pytest that check the coverage of source code. The minimal test case is

import unittest

from sos.parser import SoS_Script
from sos.workflow_executor import Base_Executor

class TestExecute(unittest.TestCase):
    def testSetVariablesTo_Output(self):
        '''Test assigning variables to _output'''
        # if there are substeps
        script = SoS_Script('''\
[10]
input: for_each=dict(i=range(2))
output: f'a_{i}.txt'
_output.touch()
''')
        wf = script.workflow()
        Base_Executor(wf).run()

if __name__ == '__main__':
    unittest.main()

Because this test uses multiprocessing, it seems that the pytest-cov adds some hooks to multiprocesses and makes sos hang.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

Maybe this is related to https://pytest-cov.readthedocs.io/en/latest/mp.html.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 29, 2019

Good, after installing pytest-cov locally, I can reproduce the hang....

@BoPeng
Copy link
Contributor Author

BoPeng commented Feb 1, 2019

Will fix after the upstream fix (pytest-dev/pytest-cov#262).

@BoPeng BoPeng closed this as completed Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants