-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
potentially flaky tests test_piped_exception1 and test_piped_exception2 #541
Comments
@dvzrv Are you able to provide the image for the container that this fails in? It will assist with the debugging |
Hm, this is a bit tricky. We do not build e.g. in docker containers but in a systemd-nspawn on a bare metal machine (usually). I guess the closest/fastest thing you can get to this is by spinning up a vagrant machine:
Then log in to the VM and install required things:
Check out the PKGBUILD for the package and build it (still on the VM):
Note, that the above will build the package without the disabled tests. To enable them modify the PKGBUILD to your needs (e.g. remove the |
Thanks for the detailed info @dvzrv. I'm unable to repro the issue unfortunately. I'm going to write my thoughts here, and they probably won't mean much to you, but they are mainly for future investigations into a similar issue. The TL;DR for you would be to continue ignoring those 2 tests in your package. Reopen this issue if you can find a way to repro it. One of the failing tests in question: def test_piped_exception2(self):
from sh import ErrorReturnCode_2
py = create_tmp_test("""
import sys
sys.stdout.write("line1\\n")
sys.stdout.write("line2\\n")
exit(2)
""")
py2 = create_tmp_test("")
def fn():
python(python(py.name, _piped=True), "-u", py2.name)
self.assertRaises(ErrorReturnCode_2, fn) Which is failing with an exit code 120, but also a message about a BrokenPipe. Normally sh will ignore a broken pipe error, but this error code isn't a broken pipe error, it's something else. According to this an exit code of 120 suggests that another exception happened after One possible sequence of events, which doesn't make much sense honestly, is that "line1" and "line2" are output, then |
Hi! During building the package of 1.14.0 for Arch Linux I ran the build on one of our build servers. When running the test suite using pytest (i.e.
pytest -v test.py
) every now and then the two tests would fail:I am not entirely sure whether this is a problem with the tests themselves or with the environment they are being run in.
As we build all packages in pristine systemd-nspawn containers they should be the same.... but maybe this is not true under certain circumstances when using the
/tmp
directory.I tried using
pytest
with the--basetemp
parameter buttest_piped_exception2
would still potentially fail.I have disabled the two tests for now as they influence reproducibility of the build as well.
The text was updated successfully, but these errors were encountered: