8000 [Bug]: test_figure_leak_20490 repeatedly failing on CI · Issue #27635 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[Bug]: test_figure_leak_20490 repeatedly failing on CI #27635

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

Closed
dstansby opened this issue Jan 11, 2024 · 2 comments · Fixed by #27732
Closed

[Bug]: test_figure_leak_20490 repeatedly failing on CI #27635

dstansby opened this issue Jan 11, 2024 · 2 comments · Fixed by #27732
Labels
CI: testing CI configuration and testing GUI: wx
Milestone

Comments

@dstansby
Copy link
Member

Bug summary

lib/matplotlib/tests/test_backends_interactive.py::test_figure_leak_20490[time_mem0-MPLBACKEND=wxagg-BACKEND_DEPS=wx] has been failing for a while on CI now, just on the Tests / Python 3.10 on ubuntu-20.04 (pull_request) job. See e.g. this run for an example failure.

The trace is

 ______ test_figure_leak_20490[time_mem0-MPLBACKEND=wxagg-BACKEND_DEPS=wx] ______
[gw1] linux -- Python 3.10.13 /opt/hostedtoolcache/Python/3.10.13/x64/bin/python

env = {'BACKEND_DEPS': 'wx', 'MPLBACKEND': 'wxagg'}, time_mem = (0.0, 2000000)
request = <FixtureRequest for <Function test_figure_leak_20490[time_mem0-MPLBACKEND=wxagg-BACKEND_DEPS=wx]>>

    @pytest.mark.skipif(sys.platform == "win32",
                        reason="appveyor tests fail; gh-22988 suggests reworking")
    @pytest.mark.parametrize("env", _get_testable_interactive_backends())
    @pytest.mark.parametrize("time_mem", [(0.0, 2_000_000), (0.1, 30_000_000)])
    def test_figure_leak_20490(env, time_mem, request):
        pytest.importorskip("psutil", reason="psutil needed to run this test")
    
        # We haven't yet directly identified the leaks so test with a memory growth
        # threshold.
        pause_time, acceptable_memory_leakage = time_mem
        if env["MPLBACKEND"] == "wx":
            pytest.skip("wx backend is deprecated; tests failed on appveyor")
    
        if env["MPLBACKEND"] == "macosx":
            request.node.add_marker(pytest.mark.xfail(reason="macosx backend is leaky"))
    
        if env["MPLBACKEND"] == "tkagg" and sys.platform == "darwin":
            acceptable_memory_leakage += 11_000_000
    
        result = _run_helper(
            _test_figure_leak, str(pause_time),
            timeout=_test_timeout, extra_env=env)
    
        growth = int(result.stdout)
>       assert growth <= acceptable_memory_leakage
E       AssertionError

lib/matplotlib/tests/test_backends_interactive.py:687: AssertionError

Code for reproduction

n/a

Actual outcome

Failing test

Expected outcome

Passing test

Additional information

No response

Operating system

No response

Matplotlib Version

Current main

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

git checkout

@ksunden
Copy link
Member
ksunden commented Jan 11, 2024

This test has been somewhat flaky/bandaged over for a while, but something recently has seemed to shift probabilities for wx... Not sure what that would be, though as wcPython has not seen a release recently as far as I can tell.

I will cross link to the other times this test has been touched that I can find easily here:

#20490
#23384
#23094
#24711
#24397
#26680

We already fudge the numbers in some cases/ignore/xfail the test in others.

@ksunden
Copy link
Member
ksunden commented Jan 11, 2024

I am also stochastically seeing this test fail locally (with wxagg) but with a slightly different presentation:

subprocess.CalledProcessError: Command '['/home/kyle/venvs/pyenv/versions/3.11.4/envs/edge/bin/python3.11', '-c', "import importlib.util;_spec = importlib.util.spec_from_file_location('matplotlib.tests.test_backends_interactive', '/home/kyle/src/scipy/matplotlib/lib/matplotlib/tests/test_backends_interactive.py');_module = importlib.util.module_from_spec(_spec);_spec.loader.exec_module(_module);_module._test_figure_leak()", '0.0']' 
died with <Signals.SIGTRAP: 5>.

I'm not sure what is sending SIGTRAP, though I guess it could be memory related somewhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: testing CI configuration and testing GUI: wx
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0