Skip to content

Commit 6aa0277

Browse files
committed
use DryRun to validate the config
1 parent 0975ae1 commit 6aa0277

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

internal/pkg/otel/samples_test.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
package otel
66

77
import (
8-
"context"
98
"os"
109
"path/filepath"
1110
"runtime"
1211
"testing"
13-
"time"
1412

1513
"github.com/stretchr/testify/assert"
1614
"go.opentelemetry.io/collector/featuregate"
@@ -60,13 +58,6 @@ func testSample(t *testing.T, configFile string) {
6058
collector, err := otelcol.NewCollector(*settings)
6159
assert.NoError(t, err)
6260
assert.NotNil(t, collector)
63-
64-
wg := startCollector(context.Background(), t, collector, "")
65-
66-
assert.Eventually(t, func() bool {
67-
return otelcol.StateRunning == collector.GetState()
68-
}, 20*time.Second, 200*time.Millisecond)
61+
assert.NoError(t, collector.DryRun(t.Context()))
6962
collector.Shutdown()
70-
wg.Wait()
71-
assert.Equal(t, otelcol.StateClosed, collector.GetState())
7263
}

0 commit comments

Comments
 (0)