Skip to content

Commit

Permalink
APM: Skip flaky trace config hostname test (#32233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgajg1134 authored Dec 18, 2024
1 parent de81141 commit 8949577
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions comp/trace/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"bufio"
"bytes"
"context"
_ "embed"
"encoding/json"
"errors"
"net/http"
Expand Down Expand Up @@ -245,6 +246,9 @@ func TestTelemetryEndpointsConfig(t *testing.T) {
})
}

//go:embed testdata/stringcode.go.tmpl
var stringCodeBody string

func TestConfigHostname(t *testing.T) {
t.Run("fail", func(t *testing.T) {
overrides := map[string]interface{}{
Expand Down Expand Up @@ -360,19 +364,14 @@ func TestConfigHostname(t *testing.T) {
})

t.Run("external", func(t *testing.T) {
body, err := os.ReadFile("testdata/stringcode.go.tmpl")
if err != nil {
t.Fatal(err)
}

// makeProgram creates a new binary file which returns the given response and exits to the OS
// given the specified code, returning the path of the program.
makeProgram := func(t *testing.T, response string, code int) string {
f, err := os.CreateTemp("", "trace-test-hostname.*.go")
if err != nil {
t.Fatal(err)
}
tmpl, err := template.New("program").Parse(string(body))
tmpl, err := template.New("program").Parse(stringCodeBody)
if err != nil {
t.Fatal(err)
}
Expand All @@ -399,6 +398,7 @@ func TestConfigHostname(t *testing.T) {
fallbackHostnameFunc = func() (string, error) { return "fallback.host", nil }

t.Run("good", func(t *testing.T) {
t.Skip("Skip flaky test while we explore fixes.")
bin := makeProgram(t, "host.name", 0)
defer os.Remove(bin)

Expand Down

0 comments on commit 8949577

Please sign in to comment.