Closed a-gavin closed 3 years ago
To follow up on this, the bug occurred while attempting to setup the package to test/do development on in a Docker container. Most tests failed initially (thus allowing for this bug to occur).
Running the container with --cap-add=SYS_PTRACE
resulted in all tests performing as expected (testsuite passed) when running make check
within the container itself. A more thorough explanation can be found here.
Issue is caused by C-style reliance on the import of subprocess in tests/testsuite.py on this line. Module subprocess is only visible within the scope of testsuite, not deadlock.py. See this StackOverflow post for a better explanation of the issue generally.
Thanks for the detailed analysis and explanation.
This issue can be fixed by directly importing subprocess in tests/testsuite.py or by changing the usage to reference the import within testsuite (i.e.
except testsuite.subprocess.TimeoutExpired
), depending on project preference. I have verified that both methods prevent the second exception from occurring.
There's no project-wide preference. If I were to choose, I'd probably import subprocess in deadlock.py to avoid making lines too long, but that's more personal taste than project guidelines. If you were to write a patch, you could do it according to your own preference.
Would you be willing to send a pull request with this fix?
Definitely! I agree on the long lines. PR submitted
Fixed by #22
In cloning/configuring the repository as instructed in Getting Started, I ran into the following error in the
make check
step (partial output from tests/test-suite.log):Issue is caused by C-style reliance on the import of subprocess in tests/testsuite.py on this line. Module subprocess is only visible within the scope of testsuite, not deadlock.py. See this StackOverflow post for a better explanation of the issue generally.
This issue can be fixed by directly importing subprocess in tests/testsuite.py or by changing the usage to reference the import within testsuite (i.e.
except testsuite.subprocess.TimeoutExpired
), depending on project preference. I have verified that both methods prevent the second exception from occurring.