Verify custom resource attributes support (#32).
Co-authored-by: p-pautov <37922380+p-pautov@users.noreply.github.com>
This commit is contained in:
parent
1d25954274
commit
c9136f2ec8
2 changed files with 38 additions and 8 deletions
|
|
@ -14,16 +14,20 @@ class TraceService(trace_service_pb2_grpc.TraceServiceServicer):
|
|||
self.batches.append(request.resource_spans)
|
||||
return trace_service_pb2.ExportTracePartialSuccess()
|
||||
|
||||
def get_span(self):
|
||||
def get_batch(self):
|
||||
for _ in range(10):
|
||||
if len(self.batches):
|
||||
break
|
||||
time.sleep(0.001)
|
||||
assert len(self.batches) == 1
|
||||
assert len(self.batches[0]) == 1
|
||||
return self.batches.pop()[0]
|
||||
|
||||
assert len(self.batches) == 1, "No spans received"
|
||||
span = self.batches[0][0].scope_spans[0].spans.pop()
|
||||
self.batches.clear()
|
||||
return span
|
||||
def get_span(self):
|
||||
batch = self.get_batch()
|
||||
assert len(batch.scope_spans) == 1
|
||||
assert len(batch.scope_spans[0].spans) == 1
|
||||
return batch.scope_spans[0].spans.pop()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue