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

sdk/trace: Manage trace environment variables in testing package (#6552)

Fix: #6542

Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
Zhengke Zhou
2025-03-28 16:45:34 +08:00
committed by GitHub
parent f88f3f19c7
commit 63f3cfe1b5
4 changed files with 11 additions and 42 deletions

View File

@@ -16,7 +16,6 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/sdk/internal/env"
ottest "go.opentelemetry.io/otel/sdk/internal/internaltest"
"go.opentelemetry.io/otel/trace"
)
@@ -247,16 +246,6 @@ func TestNewBatchSpanProcessorWithEnvOptions(t *testing.T) {
},
}
envStore := ottest.NewEnvStore()
envStore.Record(env.BatchSpanProcessorScheduleDelayKey)
envStore.Record(env.BatchSpanProcessorExportTimeoutKey)
envStore.Record(env.BatchSpanProcessorMaxQueueSizeKey)
envStore.Record(env.BatchSpanProcessorMaxExportBatchSizeKey)
defer func() {
require.NoError(t, envStore.Restore())
}()
for _, option := range options {
t.Run(option.name, func(t *testing.T) {
for k, v := range option.envs {