Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions contrib/gin-gonic/gin/gintrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ func TestServiceName(t *testing.T) {
// TestTracerStartedMultipleTimes tests a v2 regression where the global service name was being set to an empty string
// when the tracer is started more than once.
func TestTracerStartedMultipleTimes(t *testing.T) {
// tracer.WithService below overwrites the global service name, this call
// ensures we restore it its previous value after this test finishes.
testutils.SetGlobalServiceName(t, "")

tt1 := testtracer.Start(t)
defer tt1.Stop()
tt2 := testtracer.Start(t, testtracer.WithTracerStartOpts(tracer.WithService("global_service")))
Expand Down
2 changes: 2 additions & 0 deletions contrib/log/slog/slog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func testLogger(t *testing.T, createLogger func(b io.Writer) *slog.Logger, asser
spanID := strconv.FormatUint(span.Context().SpanID(), 10)
if os.Getenv("DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED") == "false" {
// Re-initialize to account for race condition between setting env var in the test and reading it in the contrib
oldCfg := cfg
t.Cleanup(func() { cfg = oldCfg })
cfg = newConfig()
traceID = strconv.FormatUint(span.Context().TraceIDLower(), 10)
} else {
Expand Down
2 changes: 2 additions & 0 deletions contrib/sirupsen/logrus/logrus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func TestFire128BitDisabled(t *testing.T) {
t.Setenv("DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED", "false")

// Re-initialize to account for race condition between setting env var in the test and reading it in the contrib
oldCfg := cfg
t.Cleanup(func() { cfg = oldCfg })
cfg = newConfig()

tracer.Start()
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci_test_contrib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for contrib in $CONTRIBS; do
go get k8s.io/[email protected]
fi
go mod tidy
gotestsum --junitfile "${TEST_RESULTS}/gotestsum-report-$contrib_id.xml" -- ./... -v -race -coverprofile="coverage-$contrib_id.txt" -covermode=atomic
gotestsum --junitfile "${TEST_RESULTS}/gotestsum-report-$contrib_id.xml" -- ./... -v -race -coverprofile="coverage-$contrib_id.txt" -covermode=atomic --shuffle=on
test_exit=$?
[[ $test_exit -ne 0 ]] && report_error=1
cd - > /dev/null || exit 1
Expand All @@ -58,7 +58,7 @@ for mod in $INSTRUMENTATION_SUBMODULES; do
# When the issue is resolved, this line can be removed.
go get k8s.io/[email protected]
fi
gotestsum --junitfile "${TEST_RESULTS}/gotestsum-report-$mod_id.xml" -- ./... -v -race -coverprofile="coverage-$mod_id.txt" -covermode=atomic
gotestsum --junitfile "${TEST_RESULTS}/gotestsum-report-$mod_id.xml" -- ./... -v -race -coverprofile="coverage-$mod_id.txt" -covermode=atomic --shuffle=on
test_exit=$?
[[ $test_exit -ne 0 ]] && report_error=1
cd - > /dev/null || exit 1
Expand Down
Loading