Skip to content

Commit 2380266

Browse files
committed
chore: log active threads that are still running after ending the tests
1 parent cdf917d commit 2380266

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/integration/container/test_aurora_failover.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import annotations
1616

17+
import threading
1718
from time import sleep
1819
from typing import TYPE_CHECKING, List
1920

@@ -56,6 +57,10 @@ def setup_method(self, request):
5657
self.logger.info(f"Starting test: {request.node.name}")
5758
yield
5859
self.logger.info(f"Ending test: {request.node.name}")
60+
active_threads = threading.enumerate()
61+
self.logger.info(f"Active threads after test: {len(active_threads)}")
62+
for thread in active_threads:
63+
self.logger.info(f" - {thread.name} (daemon: {thread.daemon})")
5964

6065
@pytest.fixture(scope='class')
6166
def aurora_utility(self):

tests/integration/container/test_read_write_splitting.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import gc
16+
import threading
1617

1718
import pytest
1819
from sqlalchemy import PoolProxiedConnection
@@ -60,6 +61,11 @@ def setup_method(self, request):
6061
self.logger.info(f"Starting test: {request.node.name}")
6162
yield
6263
self.logger.info(f"Ending test: {request.node.name}")
64+
active_threads = threading.enumerate()
65+
self.logger.info(f"Active threads after test: {len(active_threads)}")
66+
for thread in active_threads:
67+
self.logger.info(f" - {thread.name} (daemon: {thread.daemon})")
68+
6369

6470
@pytest.fixture(scope='class')
6571
def rds_utils(self):

0 commit comments

Comments
 (0)