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

WIP: Debug ResourceWarnings BufferedRandom #44877

Closed
wants to merge 27 commits into from

Conversation

mroeschke
Copy link
Member

xref #44844

@mroeschke mroeschke marked this pull request as draft December 14, 2021 07:15
@twoertwein
Copy link
Member

might be good to have a test whether lsof finds ResourceWarnings (the psutil doesn't seem to find them/some of them).

with pytest.raises(...):
    with check_bufferedrandom_resourcewarning():
        foo = open("foo")
foo.close()

Specifically enabling ResourceWarnings (usually disabled by default) seemed to work well for me in #39047: adding always::ResourceWarning to filterwarnings in setup.cfg.

pat = re.compile(r"(0?[1-9]|1[0-9]|2[0-5])u")


@pytest.fixture(autouse=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just enable for pandas.tests.io?

@mroeschke
Copy link
Member Author

might be good to have a test whether lsof finds ResourceWarnings (the psutil doesn't seem to find them/some of them).

with pytest.raises(...):
    with check_bufferedrandom_resourcewarning():
        foo = open("foo")
foo.close()

Specifically enabling ResourceWarnings (usually disabled by default) seemed to work well for me in #39047: adding always::ResourceWarning to filterwarnings in setup.cfg.

Yeah might do this in a follow up. Ideally just checking which tests open up new OS-level file handles. Apparently the BufferedResourceWarning opens it up at n=10

@mroeschke
Copy link
Member Author

Closing in favor of #45073

@mroeschke mroeschke closed this Dec 26, 2021
@mroeschke mroeschke deleted the debug/resourcewarning branch December 26, 2021 06:31
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

Successfully merging this pull request may close these issues.

3 participants