1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-25 22:41:46 +02:00

Process the queue until no data but respect max batch size (#599)

This commit is contained in:
Joshua MacDonald
2020-03-27 16:21:20 -07:00
committed by GitHub
parent e8546e3bc5
commit 1e8e72b530
2 changed files with 47 additions and 26 deletions

View File

@@ -143,6 +143,19 @@ func TestNewBatchSpanProcessorWithOptions(t *testing.T) {
waitTime: waitTime,
parallel: true,
},
{
name: "parallel span blocking",
o: []sdktrace.BatchSpanProcessorOption{
sdktrace.WithScheduleDelayMillis(schDelay),
sdktrace.WithMaxExportBatchSize(200),
sdktrace.WithBlocking(),
},
wantNumSpans: 2000,
wantBatchCount: 10,
genNumSpans: 2000,
waitTime: waitTime,
parallel: true,
},
}
for _, option := range options {
te := testBatchExporter{}
@@ -158,6 +171,8 @@ func TestNewBatchSpanProcessorWithOptions(t *testing.T) {
time.Sleep(option.waitTime)
tp.UnregisterSpanProcessor(ssp)
gotNumOfSpans := te.len()
if option.wantNumSpans != gotNumOfSpans {
t.Errorf("%s: number of exported span: got %+v, want %+v\n", option.name, gotNumOfSpans, option.wantNumSpans)