Skip to content

Commit

Permalink
Fix TestGRPCServerWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-psi committed Jun 18, 2024
1 parent 9b0456f commit 9421dc1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/extension/auth"
"go.opentelemetry.io/collector/extension/auth/authtest"
"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/internal/localhostgate"
"go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp"
)

Expand Down Expand Up @@ -437,6 +439,13 @@ func TestUseSecure(t *testing.T) {
}

func TestGRPCServerWarning(t *testing.T) {
prev := localhostgate.UseLocalHostAsDefaultHostfeatureGate.IsEnabled()
require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, false))
defer func() {
// Restore previous value.
require.NoError(t, featuregate.GlobalRegistry().Set(localhostgate.UseLocalHostAsDefaultHostID, prev))
}()

tests := []struct {
name string
settings ServerConfig
Expand Down

0 comments on commit 9421dc1

Please sign in to comment.