mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-12 10:04:29 +02:00
Fix data race in periodic reader tests (#4731)
This commit is contained in:
parent
47ba653e69
commit
204be6157f
@ -202,8 +202,6 @@ type periodicReaderTestSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ts *periodicReaderTestSuite) SetupTest() {
|
func (ts *periodicReaderTestSuite) SetupTest() {
|
||||||
ts.Reader = ts.Factory()
|
|
||||||
|
|
||||||
e := &fnExporter{
|
e := &fnExporter{
|
||||||
exportFunc: func(context.Context, *metricdata.ResourceMetrics) error { return assert.AnError },
|
exportFunc: func(context.Context, *metricdata.ResourceMetrics) error { return assert.AnError },
|
||||||
flushFunc: func(context.Context) error { return assert.AnError },
|
flushFunc: func(context.Context) error { return assert.AnError },
|
||||||
@ -429,12 +427,13 @@ func TestPeriodicReaderMultipleForceFlush(t *testing.T) {
|
|||||||
r.register(testSDKProducer{})
|
r.register(testSDKProducer{})
|
||||||
require.NoError(t, r.ForceFlush(ctx))
|
require.NoError(t, r.ForceFlush(ctx))
|
||||||
require.NoError(t, r.ForceFlush(ctx))
|
require.NoError(t, r.ForceFlush(ctx))
|
||||||
|
require.NoError(t, r.Shutdown(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkPeriodicReader(b *testing.B) {
|
func BenchmarkPeriodicReader(b *testing.B) {
|
||||||
b.Run("Collect", benchReaderCollectFunc(
|
r := NewPeriodicReader(new(fnExporter))
|
||||||
NewPeriodicReader(new(fnExporter)),
|
b.Run("Collect", benchReaderCollectFunc(r))
|
||||||
))
|
require.NoError(b, r.Shutdown(context.Background()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPeriodiclReaderTemporality(t *testing.T) {
|
func TestPeriodiclReaderTemporality(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user