fix testcontainers docker client using the global tracer provider (#5440)

This commit is contained in:
Joe Kralicky 2025-01-24 14:55:21 -05:00 committed by GitHub
parent 6ea51149f9
commit c307ca806a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View file

@ -8,8 +8,10 @@ import (
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"github.com/pomerium/pomerium/internal/telemetry/trace"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
oteltrace "go.opentelemetry.io/otel/trace"
)
// WithTestPostgres starts a postgres database.
@ -17,6 +19,7 @@ func WithTestPostgres(t *testing.T, handler func(dsn string)) {
t.Helper()
ctx := GetContext(t, maxWait)
ctx = oteltrace.ContextWithSpan(ctx, trace.ValidNoopSpan{})
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{