Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
mackjmr committed Oct 2, 2024
1 parent a782f0a commit a7ae565
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions exporter/influxdbexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import (
)

func TestLoadConfig(t *testing.T) {
defaultTransport := http.DefaultTransport.(*http.Transport)
defaultMaxIdleConns := http.DefaultTransport.(*http.Transport).MaxIdleConns
defaultMaxIdleConnsPerHost := http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost
defaultMaxConnsPerHost := http.DefaultTransport.(*http.Transport).MaxConnsPerHost
defaultIdleConnTimeout := http.DefaultTransport.(*http.Transport).IdleConnTimeout
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
Expand All @@ -44,10 +47,10 @@ func TestLoadConfig(t *testing.T) {
Endpoint: "http://localhost:8080",
Timeout: 500 * time.Millisecond,
Headers: map[string]configopaque.String{"User-Agent": "OpenTelemetry -> Influx"},
MaxIdleConns: &defaultTransport.MaxIdleConns,
MaxIdleConnsPerHost: &defaultTransport.MaxIdleConnsPerHost,
MaxConnsPerHost: &defaultTransport.MaxConnsPerHost,
IdleConnTimeout: &defaultTransport.IdleConnTimeout,
MaxIdleConns: &defaultMaxIdleConns,
MaxIdleConnsPerHost: &defaultMaxIdleConnsPerHost,
MaxConnsPerHost: &defaultMaxConnsPerHost,
IdleConnTimeout: &defaultIdleConnTimeout,
},
QueueSettings: exporterhelper.QueueConfig{
Enabled: true,
Expand Down

0 comments on commit a7ae565

Please sign in to comment.