From 333c777dca18a589df178a2476ca9224340e6a10 Mon Sep 17 00:00:00 2001 From: Colton Myers Date: Tue, 10 Oct 2023 15:18:50 -0600 Subject: [PATCH] Use non-sending client fixture in `test_grpc_client_max_spans` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test appeared to be causing a segfault in py3.12, perhaps due to being short-lived (as it wasn't waiting for anything to be sent to the sending_elasticapm_client, or closing it). It didn't actually need the sending version, so hopefully this fixes that issue 🤞 --- tests/contrib/grpc/grpc_client_tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/contrib/grpc/grpc_client_tests.py b/tests/contrib/grpc/grpc_client_tests.py index acd09fe02..5be570be9 100644 --- a/tests/contrib/grpc/grpc_client_tests.py +++ b/tests/contrib/grpc/grpc_client_tests.py @@ -239,13 +239,13 @@ def test_grpc_client_unsampled_transaction(instrument, sending_elasticapm_client assert len(payloads) == 1 # only the server_version request -@pytest.mark.parametrize("sending_elasticapm_client", [{"transaction_max_spans": 1}], indirect=True) -def test_grpc_client_max_spans(instrument, sending_elasticapm_client, grpc_client_and_server_url): +@pytest.mark.parametrize("elasticapm_client", [{"transaction_max_spans": 1}], indirect=True) +def test_grpc_client_max_spans(instrument, elasticapm_client, grpc_client_and_server_url): grpc_client, _ = grpc_client_and_server_url - transaction = sending_elasticapm_client.begin_transaction("request") + transaction = elasticapm_client.begin_transaction("request") _ = grpc_client.GetServerResponse(Message(message="foo")) _ = grpc_client.GetServerResponse(Message(message="bar")) - sending_elasticapm_client.end_transaction("grpc-test") + elasticapm_client.end_transaction("grpc-test") assert transaction.dropped_spans == 1