Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shivanthzen committed Oct 3, 2024
1 parent 43ccc5e commit 05ac9dc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion processor/batchprocessor/batch_processor_1_22.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build !1.23
//go:build !go1.23

package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor"

Expand Down
2 changes: 1 addition & 1 deletion processor/batchprocessor/batch_processor_1_23.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:build 1.23
//go:build go1.23

package batchprocessor // import "go.opentelemetry.io/collector/processor/batchprocessor"

Expand Down
32 changes: 32 additions & 0 deletions processor/batchprocessor/batch_processor_timer_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//go:build go1.23

package batchprocessor

import (
"context"
"testing"
"time"
)

func TestShardTimer(t *testing.T) {
_timer := time.NewTimer(1 * time.Millisecond)
testShard := shard{
processor: nil,
exportCtx: context.Background(),
timer: _timer,
newItem: make(chan any),
batch: nil,
}
done := make(chan bool)
go func() {
time.Sleep(3 * time.Millisecond)
testShard.stopTimer()
done <- true
}()
select {
case <-time.NewTimer(50 * time.Millisecond).C:
t.Fail()
case <-done:
break
}
}

0 comments on commit 05ac9dc

Please sign in to comment.