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

Intermittent failure in test_unix_pipes::test_del on pypy #1277

Open
njsmith opened this issue Oct 28, 2019 · 0 comments
Open

Intermittent failure in test_unix_pipes::test_del on pypy #1277

njsmith opened this issue Oct 28, 2019 · 0 comments

Comments

@njsmith
Copy link
Member

njsmith commented Oct 28, 2019

From https://travis-ci.org/python-trio/trio/jobs/603748875:

___________________________________ test_del ___________________________________
    async def test_del():
        w, r = await make_pipe()
        f1, f2 = w.fileno(), r.fileno()
        del w, r
        gc_collect_harder()
    
        with pytest.raises(OSError) as excinfo:
>           os.close(f1)
E           Failed: DID NOT RAISE <class 'OSError'>

../../../../virtualenv/pypy3.6-7.1.1/site-packages/trio/tests/test_unix_pipes.py:112: Failed
----------------------------- Captured stderr call -----------------------------
Exception ignored in: <socket.socket fd=27, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 47668), raddr=('127.0.0.1', 39833)>
ResourceWarning: unclosed <socket.socket fd=27, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 47668), raddr=('127.0.0.1', 39833)>

Not sure what's going on here... gc_collect_harder runs gc.collect() four times, which I thought was about twice as many times as we needed to make sure that all destructors ran.

I guess we could probably hack this test to directly call __del__ instead of relying on the GC, but we have other tests that rely on gc_collect_harder that would be harder to fix (e.g. because they're checking interactions with the coroutine __del__ method built into the interpreter).

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

1 participant