Skip to content

Commit

Permalink
Use non-sending client fixture in test_grpc_client_max_spans (#1917)
Browse files Browse the repository at this point in the history
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 🤞
  • Loading branch information
basepi authored Oct 10, 2023
1 parent 78bef8c commit ead8d8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/contrib/grpc/grpc_client_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit ead8d8b

Please sign in to comment.