From d1a5291882a8da22e358e097a5b79b9e63576c1a Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 1 Mar 2024 14:25:39 -0800 Subject: [PATCH] Fix stack_dump_handler test If the test suite is run in an environment with yappi or objgraph installed, the stack_dump_handler test will activate them, and so we need to call the handler a second time to turn them off. Otherwise, test performance or errors can occur. Change-Id: If073f0e46b24fc4e9f1281f911ce287f5c23d4dd --- tests/unit/test_stack_dump.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/test_stack_dump.py b/tests/unit/test_stack_dump.py index 13e83c634e..e77eebe1fa 100644 --- a/tests/unit/test_stack_dump.py +++ b/tests/unit/test_stack_dump.py @@ -33,3 +33,6 @@ class TestStackDump(testtools.TestCase): self.assertIn("Thread", self.log_fixture.output) self.assertIn("MainThread", self.log_fixture.output) self.assertIn("test_stack_dump_logs", self.log_fixture.output) + # Call it again in case yappi or objgraph are installed in the + # venv so that we turn them back off. + zuul.cmd.stack_dump_handler(signal.SIGUSR2, None)