Skip to content

test_plots SIGKILL in autopkgtest/CI #10

Description

@NGC2023

Hi,
In Debian, test_plots leave figures open, which can accumulate and increase memory usage in constrained environments (autopkgtest/CI), leading to SIGKILL. I have created a patch to address this issue.

--- a/skopt/tests/test_plots.py
+++ b/skopt/tests/test_plots.py
@@ -23,6 +23,16 @@ from skopt.plots import (
 )
 from skopt.space import Categorical, Integer
 
+@pytest.fixture(autouse=True)
+def _close_plots():
+    """
+    Ensure matplotlib figures created during plotting tests are released.
+
+    Without this, figures can accumulate across tests and cause excessive
+    memory usage in constrained environments (e.g. CI/autopkgtest).
+    """
+    yield
+    plt.close("all")
 
 def save_axes(ax, filename):
     """Save matplotlib axes `ax` to an image `filename`."""

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions