diff --git a/tests/test_otel.py b/tests/test_otel.py index 645f6103..b94f3e5e 100644 --- a/tests/test_otel.py +++ b/tests/test_otel.py @@ -283,7 +283,7 @@ def test_batches(client, trace_service, batch_count): def test_custom_resource_attributes(client, trace_service): assert client.get("http://127.0.0.1:18080/ok").status_code == 200 - trace_service.wait_batch() + trace_service.wait_one_batch() for batch in trace_service.batches: assert get_attr(batch[0].resource, "service.name") == "test_service" diff --git a/tests/trace_service.py b/tests/trace_service.py index 0ec56ae8..5fc38270 100644 --- a/tests/trace_service.py +++ b/tests/trace_service.py @@ -14,7 +14,7 @@ def Export(self, request, context): self.batches.append(request.resource_spans) return trace_service_pb2.ExportTracePartialSuccess() - def wait_batch(self): + def wait_one_batch(self): for _ in range(10): if len(self.batches): break @@ -22,7 +22,7 @@ def wait_batch(self): assert len(self.batches) == 1, "No spans received" def get_span(self): - self.wait_batch() + self.wait_one_batch() span = self.batches[0][0].scope_spans[0].spans.pop() self.batches.clear() return span