Skip to content

Commit

Permalink
fixup! Address review notices.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimf5 committed Dec 19, 2024
1 parent bef27d4 commit e625db7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/trace_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ 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
time.sleep(0.001)
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
Expand Down

0 comments on commit e625db7

Please sign in to comment.