You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the test failure below by removing global state from the
implementation.
```
$ go test -test.shuffle 1761195191840193457 ./contrib/log/slog/
--- FAIL: TestWrapHandler (0.03s)
--- FAIL: TestWrapHandler/testLogger (0.03s)
slog_test.go:103: {"time":"2025-10-23T07:14:27.195674+02:00","level":"INFO","msg":"this is an info log with tracing information","dd.trace_id":"2097471805985655682","dd.span_id":"2097471805985655682"}
slog_test.go:103:
Error Trace: /Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:42
/Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:103
/Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:149
Error: Not equal:
expected: "68f9b9b3000000001d1bb77ea22c0b82"
actual : "2097471805985655682"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-68f9b9b3000000001d1bb77ea22c0b82
+2097471805985655682
Test: TestWrapHandler/testLogger
Messages: trace id not found
slog_test.go:104: {"time":"2025-10-23T07:14:27.195681+02:00","level":"ERROR","msg":"this is an error log with tracing information","dd.trace_id":"2097471805985655682","dd.span_id":"2097471805985655682"}
slog_test.go:104:
Error Trace: /Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:42
/Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:104
/Users/felix.geisendoerfer/go/src/github.com/DataDog/dd-trace-go/contrib/log/slog/slog_test.go:149
Error: Not equal:
expected: "68f9b9b3000000001d1bb77ea22c0b82"
actual : "2097471805985655682"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-68f9b9b3000000001d1bb77ea22c0b82
+2097471805985655682
Test: TestWrapHandler/testLogger
Messages: trace id not found
slog_test.go:132: {"time":"2025-10-23T07:14:27.203777+02:00","level":"INFO","msg":"this is an info log with tracing information"}
slog_test.go:133: {"time":"2025-10-23T07:14:27.20378+02:00","level":"ERROR","msg":"this is an error log with tracing information"}
```
0 commit comments