diff --git a/_integration-tests/tests/99designs.gqlgen/gqlgen.go b/_integration-tests/tests/99designs.gqlgen/gqlgen.go index 9ac80c7d..206e90d4 100644 --- a/_integration-tests/tests/99designs.gqlgen/gqlgen.go +++ b/_integration-tests/tests/99designs.gqlgen/gqlgen.go @@ -8,6 +8,7 @@ package gqlgen import ( + "context" "fmt" "testing" @@ -23,13 +24,13 @@ type TestCase struct { server *handler.Server } -func (tc *TestCase) Setup(*testing.T) { +func (tc *TestCase) Setup(context.Context, *testing.T) { schema := graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}}) tc.server = handler.New(schema) tc.server.AddTransport(transport.POST{}) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { c := client.New(tc.server) const ( diff --git a/_integration-tests/tests/aws.v1/aws.go b/_integration-tests/tests/aws.v1/aws.go index 96885442..028cf891 100644 --- a/_integration-tests/tests/aws.v1/aws.go +++ b/_integration-tests/tests/aws.v1/aws.go @@ -8,6 +8,7 @@ package awsv1 import ( + "context" "fmt" "testing" @@ -26,7 +27,7 @@ type TestCase struct { cfg *aws.Config } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) server, host, port := utils.StartDynamoDBTestContainer(t) @@ -39,7 +40,7 @@ func (tc *TestCase) Setup(t *testing.T) { } } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { ddb := dynamodb.New(session.Must(session.NewSession(tc.cfg))) _, err := ddb.ListTables(nil) require.NoError(t, err) diff --git a/_integration-tests/tests/aws.v2/base.go b/_integration-tests/tests/aws.v2/base.go index 799111f3..fada6463 100644 --- a/_integration-tests/tests/aws.v2/base.go +++ b/_integration-tests/tests/aws.v2/base.go @@ -11,7 +11,6 @@ import ( "context" "fmt" "testing" - "time" "datadoghq.dev/orchestrion/_integration-tests/utils" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" @@ -28,15 +27,13 @@ type base struct { port string } -func (b *base) setup(t *testing.T) { +func (b *base) setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) b.server, b.host, b.port = utils.StartDynamoDBTestContainer(t) } -func (b *base) run(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - defer cancel() +func (b *base) run(ctx context.Context, t *testing.T) { ddb := dynamodb.NewFromConfig(b.cfg) _, err := ddb.ListTables(ctx, nil) require.NoError(t, err) diff --git a/_integration-tests/tests/aws.v2/load_default_config.go b/_integration-tests/tests/aws.v2/load_default_config.go index cdfa3416..db4b30cc 100644 --- a/_integration-tests/tests/aws.v2/load_default_config.go +++ b/_integration-tests/tests/aws.v2/load_default_config.go @@ -23,10 +23,10 @@ type TestCaseLoadDefaultConfig struct { base } -func (tc *TestCaseLoadDefaultConfig) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseLoadDefaultConfig) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) - cfg, err := config.LoadDefaultConfig(context.Background(), + cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("test-region-1337"), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider("NOTANACCESSKEY", "NOTASECRETKEY", "")), ) @@ -35,8 +35,8 @@ func (tc *TestCaseLoadDefaultConfig) Setup(t *testing.T) { tc.cfg = cfg } -func (tc *TestCaseLoadDefaultConfig) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseLoadDefaultConfig) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseLoadDefaultConfig) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/aws.v2/new_config.go b/_integration-tests/tests/aws.v2/new_config.go index db66f860..28208bf7 100644 --- a/_integration-tests/tests/aws.v2/new_config.go +++ b/_integration-tests/tests/aws.v2/new_config.go @@ -8,6 +8,7 @@ package awsv2 import ( + "context" "fmt" "testing" @@ -20,8 +21,8 @@ type TestCaseNewConfig struct { base } -func (tc *TestCaseNewConfig) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseNewConfig) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) cfg := aws.NewConfig() cfg.Region = "test-region-1337" @@ -30,8 +31,8 @@ func (tc *TestCaseNewConfig) Setup(t *testing.T) { tc.cfg = *cfg } -func (tc *TestCaseNewConfig) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseNewConfig) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseNewConfig) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/aws.v2/struct_literal.go b/_integration-tests/tests/aws.v2/struct_literal.go index 1afe36b3..ad2c2d48 100644 --- a/_integration-tests/tests/aws.v2/struct_literal.go +++ b/_integration-tests/tests/aws.v2/struct_literal.go @@ -8,6 +8,7 @@ package awsv2 import ( + "context" "fmt" "testing" @@ -20,8 +21,8 @@ type TestCaseStructLiteral struct { base } -func (tc *TestCaseStructLiteral) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseStructLiteral) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) tc.cfg = aws.Config{ Region: "test-region-1337", @@ -30,8 +31,8 @@ func (tc *TestCaseStructLiteral) Setup(t *testing.T) { } } -func (tc *TestCaseStructLiteral) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteral) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseStructLiteral) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/aws.v2/struct_literal_ptr.go b/_integration-tests/tests/aws.v2/struct_literal_ptr.go index 14a61bf5..ba452f0f 100644 --- a/_integration-tests/tests/aws.v2/struct_literal_ptr.go +++ b/_integration-tests/tests/aws.v2/struct_literal_ptr.go @@ -8,6 +8,7 @@ package awsv2 import ( + "context" "fmt" "testing" @@ -20,8 +21,8 @@ type TestCaseStructLiteralPtr struct { base } -func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseStructLiteralPtr) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) cfg := &aws.Config{ Region: "test-region-1337", @@ -31,8 +32,8 @@ func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T) { tc.cfg = *cfg } -func (tc *TestCaseStructLiteralPtr) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteralPtr) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseStructLiteralPtr) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/chi.v5/chi.go b/_integration-tests/tests/chi.v5/chi.go index ab1ea728..dd21ad35 100644 --- a/_integration-tests/tests/chi.v5/chi.go +++ b/_integration-tests/tests/chi.v5/chi.go @@ -25,7 +25,7 @@ type TestCase struct { *http.Server } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { router := chi.NewRouter() tc.Server = &http.Server{ @@ -39,13 +39,14 @@ func (tc *TestCase) Setup(t *testing.T) { go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.Server.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get(fmt.Sprintf("http://%s/", tc.Server.Addr)) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/confluent-kafka-go.v1/kafka.go b/_integration-tests/tests/confluent-kafka-go.v1/kafka.go index 46cc6fd2..dcf1d7cc 100644 --- a/_integration-tests/tests/confluent-kafka-go.v1/kafka.go +++ b/_integration-tests/tests/confluent-kafka-go.v1/kafka.go @@ -8,6 +8,7 @@ package kafka import ( + "context" "strings" "testing" "time" @@ -17,6 +18,7 @@ import ( kafkatest "github.com/testcontainers/testcontainers-go/modules/kafka" "datadoghq.dev/orchestrion/_integration-tests/utils" + "datadoghq.dev/orchestrion/_integration-tests/utils/backoff" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" ) @@ -31,16 +33,16 @@ type TestCase struct { addr []string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) container, addr := utils.StartKafkaTestContainer(t) tc.container = container tc.addr = []string{addr} } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { tc.produceMessage(t) - tc.consumeMessage(t) + tc.consumeMessage(ctx, t) } func (tc *TestCase) kafkaBootstrapServers() string { @@ -74,7 +76,7 @@ func (tc *TestCase) produceMessage(t *testing.T) { require.NoError(t, err, "failed to send message") } -func (tc *TestCase) consumeMessage(t *testing.T) { +func (tc *TestCase) consumeMessage(ctx context.Context, t *testing.T) { t.Helper() cfg := &kafka.ConfigMap{ @@ -94,7 +96,12 @@ func (tc *TestCase) consumeMessage(t *testing.T) { }) require.NoError(t, err) - m, err := c.ReadMessage(3000 * time.Millisecond) + m, err := backoff.Retry( + ctx, + backoff.NewExponentialStrategy(100*time.Millisecond, 2, time.Second), + func() (*kafka.Message, error) { return c.ReadMessage(3 * time.Second) }, + nil, + ) require.NoError(t, err) _, err = c.CommitMessage(m) diff --git a/_integration-tests/tests/confluent-kafka-go.v2/kafka.go b/_integration-tests/tests/confluent-kafka-go.v2/kafka.go index add0e681..8829fac7 100644 --- a/_integration-tests/tests/confluent-kafka-go.v2/kafka.go +++ b/_integration-tests/tests/confluent-kafka-go.v2/kafka.go @@ -8,6 +8,7 @@ package kafka import ( + "context" "strings" "testing" "time" @@ -17,6 +18,7 @@ import ( kafkatest "github.com/testcontainers/testcontainers-go/modules/kafka" "datadoghq.dev/orchestrion/_integration-tests/utils" + "datadoghq.dev/orchestrion/_integration-tests/utils/backoff" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" ) @@ -31,16 +33,16 @@ type TestCase struct { addr []string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) container, addr := utils.StartKafkaTestContainer(t) tc.container = container tc.addr = []string{addr} } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { tc.produceMessage(t) - tc.consumeMessage(t) + tc.consumeMessage(ctx, t) } func (tc *TestCase) kafkaBootstrapServers() string { @@ -74,7 +76,7 @@ func (tc *TestCase) produceMessage(t *testing.T) { require.NoError(t, err, "failed to send message") } -func (tc *TestCase) consumeMessage(t *testing.T) { +func (tc *TestCase) consumeMessage(ctx context.Context, t *testing.T) { t.Helper() cfg := &kafka.ConfigMap{ @@ -94,7 +96,12 @@ func (tc *TestCase) consumeMessage(t *testing.T) { }) require.NoError(t, err) - m, err := c.ReadMessage(3000 * time.Millisecond) + m, err := backoff.Retry( + ctx, + backoff.NewExponentialStrategy(100*time.Millisecond, 2, time.Second), + func() (*kafka.Message, error) { return c.ReadMessage(3 * time.Second) }, + nil, + ) require.NoError(t, err) _, err = c.CommitMessage(m) diff --git a/_integration-tests/tests/dd-span/ddspan.go b/_integration-tests/tests/dd-span/ddspan.go index cb0cba70..0810100a 100644 --- a/_integration-tests/tests/dd-span/ddspan.go +++ b/_integration-tests/tests/dd-span/ddspan.go @@ -18,10 +18,10 @@ import ( type TestCase struct{} -func (*TestCase) Setup(*testing.T) {} +func (*TestCase) Setup(context.Context, *testing.T) {} -func (*TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (*TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost:0/", nil) diff --git a/_integration-tests/tests/echo.v4/echo.go b/_integration-tests/tests/echo.v4/echo.go index 43210276..a737dc8b 100644 --- a/_integration-tests/tests/echo.v4/echo.go +++ b/_integration-tests/tests/echo.v4/echo.go @@ -26,7 +26,7 @@ type TestCase struct { addr string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { tc.Echo = echo.New() tc.Echo.Logger.SetOutput(io.Discard) @@ -37,13 +37,14 @@ func (tc *TestCase) Setup(t *testing.T) { go func() { assert.ErrorIs(t, tc.Echo.Start(tc.addr), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() require.NoError(t, tc.Echo.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get("http://" + tc.addr + "/ping") require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/fiber.v2/fiber.go b/_integration-tests/tests/fiber.v2/fiber.go index 38b24fe1..434b670a 100644 --- a/_integration-tests/tests/fiber.v2/fiber.go +++ b/_integration-tests/tests/fiber.v2/fiber.go @@ -8,6 +8,7 @@ package fiber import ( + "context" "net/http" "testing" "time" @@ -24,18 +25,18 @@ type TestCase struct { addr string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { tc.App = fiber.New(fiber.Config{DisableStartupMessage: true}) tc.App.Get("/ping", func(c *fiber.Ctx) error { return c.JSON(map[string]any{"message": "pong"}) }) tc.addr = "127.0.0.1:" + utils.GetFreePort(t) go func() { assert.NoError(t, tc.App.Listen(tc.addr)) }() t.Cleanup(func() { - assert.NoError(t, tc.App.ShutdownWithTimeout(time.Second)) + assert.NoError(t, tc.App.ShutdownWithTimeout(10*time.Second)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get("http://" + tc.addr + "/ping") require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/gcp_pubsub/gcp_pubsub.go b/_integration-tests/tests/gcp_pubsub/gcp_pubsub.go index 49a2e8af..08804479 100644 --- a/_integration-tests/tests/gcp_pubsub/gcp_pubsub.go +++ b/_integration-tests/tests/gcp_pubsub/gcp_pubsub.go @@ -36,13 +36,10 @@ type TestCase struct { messageID string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(ctx context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) - var ( - err error - ctx = context.Background() - ) + var err error tc.container, err = gcloud.RunPubsub(ctx, "gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators", @@ -61,9 +58,7 @@ func (tc *TestCase) Setup(t *testing.T) { tc.client, err = pubsub.NewClient(ctx, projectID, option.WithGRPCConn(conn)) require.NoError(t, err) - t.Cleanup(func() { - assert.NoError(t, tc.client.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.client.Close()) }) topic, err := tc.client.CreateTopic(ctx, testTopic) require.NoError(t, err) @@ -75,26 +70,25 @@ func (tc *TestCase) Setup(t *testing.T) { require.NoError(t, err) } -func (tc *TestCase) publishMessage(t *testing.T) { - t.Helper() - - ctx := context.Background() +func (tc *TestCase) publishMessage(ctx context.Context, t *testing.T) { topic := tc.client.Topic(testTopic) topic.EnableMessageOrdering = true - res := topic.Publish(context.Background(), &pubsub.Message{ + res := topic.Publish(ctx, &pubsub.Message{ Data: []byte("Hello, World!"), OrderingKey: "ordering-key", }) - _, err := res.Get(ctx) + id, err := res.Get(ctx) require.NoError(t, err) - t.Log("finished publishing result") + t.Log("finished publishing result", id) } -func (tc *TestCase) receiveMessage(t *testing.T) { - t.Helper() - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() +func (tc *TestCase) receiveMessage(ctx context.Context, t *testing.T) { + // We use a cancellable context so we can stop listening for more messages as + // soon as we have processed one. The [pubsub.Subscription.Receive] method + // keeps listening until a non-retryable error occurs, or the context gets + // cancelled... This would effectively block the test forever! + ctx, cancel := context.WithCancel(ctx) + defer cancel() // In case the message never arrives... sub := tc.client.Subscription(testSubscription) err := sub.Receive(ctx, func(_ context.Context, message *pubsub.Message) { @@ -102,17 +96,17 @@ func (tc *TestCase) receiveMessage(t *testing.T) { message.Ack() tc.publishTime = message.PublishTime tc.messageID = message.ID - cancel() + cancel() // Stop waiting for more messages immediately... }) require.NoError(t, err) - <-ctx.Done() + // Ensure the context is not done yet... require.NotErrorIs(t, ctx.Err(), context.DeadlineExceeded) } -func (tc *TestCase) Run(t *testing.T) { - tc.publishMessage(t) - tc.receiveMessage(t) +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + tc.publishMessage(ctx, t) + tc.receiveMessage(ctx, t) } func (tc *TestCase) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/gin/gin.go b/_integration-tests/tests/gin/gin.go index dd84f54d..22631d80 100644 --- a/_integration-tests/tests/gin/gin.go +++ b/_integration-tests/tests/gin/gin.go @@ -24,7 +24,7 @@ type TestCase struct { *http.Server } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { gin.SetMode(gin.ReleaseMode) // Silence start-up logging engine := gin.New() @@ -37,13 +37,14 @@ func (tc *TestCase) Setup(t *testing.T) { go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.Server.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get("http://" + tc.Server.Addr + "/ping") require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/go-elasticsearch/base.go b/_integration-tests/tests/go-elasticsearch/base.go index b4dbbf28..50021a60 100644 --- a/_integration-tests/tests/go-elasticsearch/base.go +++ b/_integration-tests/tests/go-elasticsearch/base.go @@ -34,11 +34,9 @@ type base struct { client esClient } -func (b *base) Setup(t *testing.T, image string, newClient func(addr string, caCert []byte) (esClient, error)) { +func (b *base) Setup(ctx context.Context, t *testing.T, image string, newClient func(addr string, caCert []byte) (esClient, error)) { utils.SkipIfProviderIsNotHealthy(t) - ctx := context.Background() - var err error b.container, err = testelasticsearch.Run(ctx, image, @@ -53,8 +51,7 @@ func (b *base) Setup(t *testing.T, image string, newClient func(addr string, caC require.NoError(t, err) } -func (b *base) Run(t *testing.T, doRequest func(t *testing.T, client esClient, body io.Reader)) { - ctx := context.Background() +func (b *base) Run(ctx context.Context, t *testing.T, doRequest func(t *testing.T, client esClient, body io.Reader)) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() diff --git a/_integration-tests/tests/go-elasticsearch/v6.go b/_integration-tests/tests/go-elasticsearch/v6.go index 0852f657..63bc1ffd 100644 --- a/_integration-tests/tests/go-elasticsearch/v6.go +++ b/_integration-tests/tests/go-elasticsearch/v6.go @@ -23,22 +23,22 @@ type TestCaseV6 struct { base } -func (tc *TestCaseV6) Setup(t *testing.T) { +func (tc *TestCaseV6) Setup(ctx context.Context, t *testing.T) { // skip test if CI runner os arch is not amd64 if _, ok := os.LookupEnv("CI"); ok && runtime.GOOS == "linux" && runtime.GOARCH != "amd64" { t.Skip("Skipping test as the official elasticsearch v6 docker image only supports amd64") } else if runtime.GOOS == "darwin" && runtime.GOARCH != "amd64" { t.Skip("Skipping test as the official elasticsearch v6 docker image cannot run under rosetta") } - tc.base.Setup(t, "docker.elastic.co/elasticsearch/elasticsearch:6.8.23", func(addr string, _ []byte) (esClient, error) { + tc.base.Setup(ctx, t, "docker.elastic.co/elasticsearch/elasticsearch:6.8.23", func(addr string, _ []byte) (esClient, error) { return elasticsearch.NewClient(elasticsearch.Config{ Addresses: []string{addr}, }) }) } -func (tc *TestCaseV6) Run(t *testing.T) { - tc.base.Run(t, func(t *testing.T, client esClient, body io.Reader) { +func (tc *TestCaseV6) Run(ctx context.Context, t *testing.T) { + tc.base.Run(ctx, t, func(t *testing.T, client esClient, body io.Reader) { t.Helper() req := esapi.IndexRequest{ Index: "test", @@ -46,7 +46,7 @@ func (tc *TestCaseV6) Run(t *testing.T) { Body: body, Refresh: "true", } - res, err := req.Do(context.Background(), client) + res, err := req.Do(ctx, client) require.NoError(t, err) defer res.Body.Close() }) diff --git a/_integration-tests/tests/go-elasticsearch/v7.go b/_integration-tests/tests/go-elasticsearch/v7.go index 54780c8c..93be5121 100644 --- a/_integration-tests/tests/go-elasticsearch/v7.go +++ b/_integration-tests/tests/go-elasticsearch/v7.go @@ -21,16 +21,16 @@ type TestCaseV7 struct { base } -func (tc *TestCaseV7) Setup(t *testing.T) { - tc.base.Setup(t, "docker.elastic.co/elasticsearch/elasticsearch:7.17.24", func(addr string, _ []byte) (esClient, error) { +func (tc *TestCaseV7) Setup(ctx context.Context, t *testing.T) { + tc.base.Setup(ctx, t, "docker.elastic.co/elasticsearch/elasticsearch:7.17.24", func(addr string, _ []byte) (esClient, error) { return elasticsearch.NewClient(elasticsearch.Config{ Addresses: []string{addr}, }) }) } -func (tc *TestCaseV7) Run(t *testing.T) { - tc.base.Run(t, func(t *testing.T, client esClient, body io.Reader) { +func (tc *TestCaseV7) Run(ctx context.Context, t *testing.T) { + tc.base.Run(ctx, t, func(t *testing.T, client esClient, body io.Reader) { t.Helper() req := esapi.IndexRequest{ Index: "test", @@ -38,7 +38,7 @@ func (tc *TestCaseV7) Run(t *testing.T) { Body: body, Refresh: "true", } - res, err := req.Do(context.Background(), client) + res, err := req.Do(ctx, client) require.NoError(t, err) defer res.Body.Close() }) diff --git a/_integration-tests/tests/go-elasticsearch/v8.go b/_integration-tests/tests/go-elasticsearch/v8.go index 056ca790..65b256e0 100644 --- a/_integration-tests/tests/go-elasticsearch/v8.go +++ b/_integration-tests/tests/go-elasticsearch/v8.go @@ -24,8 +24,8 @@ type TestCaseV8 struct { base } -func (tc *TestCaseV8) Setup(t *testing.T) { - tc.base.Setup(t, "docker.elastic.co/elasticsearch/elasticsearch:8.15.3", func(addr string, caCert []byte) (esClient, error) { +func (tc *TestCaseV8) Setup(ctx context.Context, t *testing.T) { + tc.base.Setup(ctx, t, "docker.elastic.co/elasticsearch/elasticsearch:8.15.3", func(addr string, caCert []byte) (esClient, error) { // from v8, there's a certificate configured by default. // we cannot configure directly in the elasticsearch.Config type as it makes a type assertion on the underlying // transport type, which fails for the *elastictrace.roundTripper type from our instrumentation package. @@ -44,8 +44,8 @@ func (tc *TestCaseV8) Setup(t *testing.T) { }) } -func (tc *TestCaseV8) Run(t *testing.T) { - tc.base.Run(t, func(t *testing.T, client esClient, body io.Reader) { +func (tc *TestCaseV8) Run(ctx context.Context, t *testing.T) { + tc.base.Run(ctx, t, func(t *testing.T, client esClient, body io.Reader) { t.Helper() req := esapi.IndexRequest{ Index: "test", @@ -53,7 +53,7 @@ func (tc *TestCaseV8) Run(t *testing.T) { Body: body, Refresh: "true", } - res, err := req.Do(context.Background(), client) + res, err := req.Do(ctx, client) require.NoError(t, err) defer res.Body.Close() }) diff --git a/_integration-tests/tests/go-redis.v0/go-redis.go b/_integration-tests/tests/go-redis.v0/go-redis.go index 841976a3..6af4fc47 100644 --- a/_integration-tests/tests/go-redis.v0/go-redis.go +++ b/_integration-tests/tests/go-redis.v0/go-redis.go @@ -28,7 +28,7 @@ type TestCase struct { key string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) uuid, err := uuid.NewRandom() @@ -39,13 +39,11 @@ func (tc *TestCase) Setup(t *testing.T) { tc.server = container tc.Client = redis.NewClient(&redis.Options{Addr: addr}) - t.Cleanup(func() { - assert.NoError(t, tc.Client.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.Client.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() require.NoError(t, tc.Client.WithContext(ctx).Set(tc.key, "test_value", 0).Err()) diff --git a/_integration-tests/tests/go-redis.v7/go-redis.go b/_integration-tests/tests/go-redis.v7/go-redis.go index 41851d9d..9ca2855b 100644 --- a/_integration-tests/tests/go-redis.v7/go-redis.go +++ b/_integration-tests/tests/go-redis.v7/go-redis.go @@ -28,7 +28,7 @@ type TestCase struct { key string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) uuid, err := uuid.NewRandom() @@ -39,13 +39,11 @@ func (tc *TestCase) Setup(t *testing.T) { tc.server = container tc.Client = redis.NewClient(&redis.Options{Addr: addr}) - t.Cleanup(func() { - assert.NoError(t, tc.Client.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.Client.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() require.NoError(t, tc.Client.WithContext(ctx).Set(tc.key, "test_value", 0).Err()) diff --git a/_integration-tests/tests/go-redis.v8/go-redis.go b/_integration-tests/tests/go-redis.v8/go-redis.go index 4744cb50..fc11adde 100644 --- a/_integration-tests/tests/go-redis.v8/go-redis.go +++ b/_integration-tests/tests/go-redis.v8/go-redis.go @@ -27,7 +27,7 @@ type TestCase struct { key string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) uuid, err := uuid.NewRandom() @@ -38,13 +38,11 @@ func (tc *TestCase) Setup(t *testing.T) { tc.server = container tc.Client = redis.NewClient(&redis.Options{Addr: addr}) - t.Cleanup(func() { - assert.NoError(t, tc.Client.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.Client.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() require.NoError(t, tc.Client.Set(ctx, "test_key", "test_value", 0).Err()) diff --git a/_integration-tests/tests/go-redis.v9/go-redis.go b/_integration-tests/tests/go-redis.v9/go-redis.go index 1e5d630f..f87e085e 100644 --- a/_integration-tests/tests/go-redis.v9/go-redis.go +++ b/_integration-tests/tests/go-redis.v9/go-redis.go @@ -11,7 +11,6 @@ import ( "context" "fmt" "testing" - "time" "datadoghq.dev/orchestrion/_integration-tests/utils" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" @@ -29,7 +28,7 @@ type TestCase struct { key string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) uuid, err := uuid.NewRandom() @@ -40,29 +39,17 @@ func (tc *TestCase) Setup(t *testing.T) { tc.server = container tc.Client = redis.NewClient(&redis.Options{Addr: addr}) - t.Cleanup(func() { - assert.NoError(t, tc.Client.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.Client.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() require.NoError(t, tc.Client.Set(ctx, tc.key, "test_value", 0).Err()) require.NoError(t, tc.Client.Get(ctx, tc.key).Err()) } -func (tc *TestCase) Teardown(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - - assert.NoError(t, tc.Client.Close()) - if tc.server != nil && assert.NoError(t, tc.server.Terminate(ctx)) { - tc.server = nil - } -} - func (tc *TestCase) ExpectedTraces() trace.Traces { return trace.Traces{ { diff --git a/_integration-tests/tests/gocql/base.go b/_integration-tests/tests/gocql/base.go index f3c47219..33f9673c 100644 --- a/_integration-tests/tests/gocql/base.go +++ b/_integration-tests/tests/gocql/base.go @@ -11,12 +11,10 @@ import ( "context" "net" "testing" - "time" "datadoghq.dev/orchestrion/_integration-tests/utils" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" "github.com/gocql/gocql" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" testcassandra "github.com/testcontainers/testcontainers-go/modules/cassandra" @@ -30,11 +28,9 @@ type base struct { port string } -func (b *base) setup(t *testing.T) { +func (b *base) setup(ctx context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) - ctx := context.Background() - var err error b.container, err = testcassandra.Run(ctx, "cassandra:4.1", @@ -51,16 +47,8 @@ func (b *base) setup(t *testing.T) { require.NoError(t, err) } -func (b *base) teardown(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) - defer cancel() - - b.session.Close() - assert.NoError(t, b.container.Terminate(ctx)) -} - -func (b *base) run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (b *base) run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() err := b.session. diff --git a/_integration-tests/tests/gocql/new_cluster.go b/_integration-tests/tests/gocql/new_cluster.go index 773d8c3c..b6c7b85a 100644 --- a/_integration-tests/tests/gocql/new_cluster.go +++ b/_integration-tests/tests/gocql/new_cluster.go @@ -8,6 +8,7 @@ package gocql import ( + "context" "testing" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" @@ -19,20 +20,18 @@ type TestCaseNewCluster struct { base } -func (tc *TestCaseNewCluster) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseNewCluster) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) var err error cluster := gocql.NewCluster(tc.hostPort) tc.session, err = cluster.CreateSession() require.NoError(t, err) - t.Cleanup(func() { - tc.session.Close() - }) + t.Cleanup(func() { tc.session.Close() }) } -func (tc *TestCaseNewCluster) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseNewCluster) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseNewCluster) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/gocql/struct_literal.go b/_integration-tests/tests/gocql/struct_literal.go index 5842fc92..e0a175c1 100644 --- a/_integration-tests/tests/gocql/struct_literal.go +++ b/_integration-tests/tests/gocql/struct_literal.go @@ -8,6 +8,7 @@ package gocql import ( + "context" "testing" "time" @@ -20,8 +21,8 @@ type TestCaseStructLiteral struct { base } -func (tc *TestCaseStructLiteral) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseStructLiteral) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) var err error cluster := gocql.ClusterConfig{ @@ -43,13 +44,11 @@ func (tc *TestCaseStructLiteral) Setup(t *testing.T) { } tc.session, err = cluster.CreateSession() require.NoError(t, err) - t.Cleanup(func() { - tc.session.Close() - }) + t.Cleanup(func() { tc.session.Close() }) } -func (tc *TestCaseStructLiteral) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteral) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseStructLiteral) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/gocql/struct_literal_ptr.go b/_integration-tests/tests/gocql/struct_literal_ptr.go index 1714523a..e5ed89e8 100644 --- a/_integration-tests/tests/gocql/struct_literal_ptr.go +++ b/_integration-tests/tests/gocql/struct_literal_ptr.go @@ -8,6 +8,7 @@ package gocql import ( + "context" "testing" "time" @@ -20,8 +21,8 @@ type TestCaseStructLiteralPtr struct { base } -func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T) { - tc.setup(t) +func (tc *TestCaseStructLiteralPtr) Setup(ctx context.Context, t *testing.T) { + tc.setup(ctx, t) var err error cluster := &gocql.ClusterConfig{ @@ -43,13 +44,11 @@ func (tc *TestCaseStructLiteralPtr) Setup(t *testing.T) { } tc.session, err = cluster.CreateSession() require.NoError(t, err) - t.Cleanup(func() { - tc.session.Close() - }) + t.Cleanup(func() { tc.session.Close() }) } -func (tc *TestCaseStructLiteralPtr) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteralPtr) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseStructLiteralPtr) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/gorilla_mux/gorilla_mux.go b/_integration-tests/tests/gorilla_mux/gorilla_mux.go index 9953c003..9a4b23ad 100644 --- a/_integration-tests/tests/gorilla_mux/gorilla_mux.go +++ b/_integration-tests/tests/gorilla_mux/gorilla_mux.go @@ -26,7 +26,7 @@ type TestCase struct { *http.Server } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { router := mux.NewRouter() tc.Server = &http.Server{ Addr: "127.0.0.1:" + utils.GetFreePort(t), @@ -41,13 +41,14 @@ func (tc *TestCase) Setup(t *testing.T) { go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.Server.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get(fmt.Sprintf("http://%s/ping", tc.Server.Addr)) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/gorm.jinzhu/gorm.go b/_integration-tests/tests/gorm.jinzhu/gorm.go index 208936d1..d601cdf6 100644 --- a/_integration-tests/tests/gorm.jinzhu/gorm.go +++ b/_integration-tests/tests/gorm.jinzhu/gorm.go @@ -24,13 +24,11 @@ type TestCase struct { *gorm.DB } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { var err error tc.DB, err = gorm.Open("sqlite3", "file::memory:") require.NoError(t, err) - t.Cleanup(func() { - assert.NoError(t, tc.DB.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.DB.Close()) }) require.NoError(t, tc.DB.AutoMigrate(&Note{}).Error) for _, note := range []*Note{ @@ -45,8 +43,8 @@ func (tc *TestCase) Setup(t *testing.T) { } } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() var note Note diff --git a/_integration-tests/tests/gorm/gorm.go b/_integration-tests/tests/gorm/gorm.go index 6fe63065..8826490c 100644 --- a/_integration-tests/tests/gorm/gorm.go +++ b/_integration-tests/tests/gorm/gorm.go @@ -23,7 +23,7 @@ type TestCase struct { *gorm.DB } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { var err error tc.DB, err = gorm.Open(sqlite.Open("file::memory:"), &gorm.Config{}) require.NoError(t, err) @@ -40,8 +40,8 @@ func (tc *TestCase) Setup(t *testing.T) { }, 10).Error) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() var note Note diff --git a/_integration-tests/tests/graph-gophers/graphql-go.go b/_integration-tests/tests/graph-gophers/graphql-go.go index 4348a053..0c853af5 100644 --- a/_integration-tests/tests/graph-gophers/graphql-go.go +++ b/_integration-tests/tests/graph-gophers/graphql-go.go @@ -9,6 +9,7 @@ package graphgophers import ( "bytes" + "context" "encoding/json" "io" "net/http" @@ -40,17 +41,15 @@ func (*resolver) Hello() string { return "Hello, world!" } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { schema, err := graphql.ParseSchema(schema, new(resolver)) require.NoError(t, err) tc.server = httptest.NewServer(&relay.Handler{Schema: schema}) - t.Cleanup(func() { - tc.server.Close() - }) + t.Cleanup(func() { tc.server.Close() }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { req, err := http.NewRequest(http.MethodPost, tc.server.URL, bytes.NewReader([]byte(`{"query": "{ hello }"}`))) require.NoError(t, err) diff --git a/_integration-tests/tests/graphql-go/graphql.go b/_integration-tests/tests/graphql-go/graphql.go index 14f816b5..3b7900ba 100644 --- a/_integration-tests/tests/graphql-go/graphql.go +++ b/_integration-tests/tests/graphql-go/graphql.go @@ -9,6 +9,7 @@ package graphql import ( "bytes" + "context" "encoding/json" "io" "net/http" @@ -25,7 +26,7 @@ type TestCase struct { server *httptest.Server } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { schema, err := graphql.NewSchema(graphql.SchemaConfig{ Query: graphql.NewObject(graphql.ObjectConfig{ Name: "Query", @@ -44,12 +45,10 @@ func (tc *TestCase) Setup(t *testing.T) { require.NoError(t, err) tc.server = httptest.NewServer(handler.New(&handler.Config{Schema: &schema})) - t.Cleanup(func() { - tc.server.Close() - }) + t.Cleanup(func() { tc.server.Close() }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { req, err := http.NewRequest("POST", tc.server.URL, bytes.NewReader([]byte(`{"query": "{ hello }"}`))) require.NoError(t, err) diff --git a/_integration-tests/tests/grpc/grpc.go b/_integration-tests/tests/grpc/grpc.go index a382f6ea..bd5c3b8d 100644 --- a/_integration-tests/tests/grpc/grpc.go +++ b/_integration-tests/tests/grpc/grpc.go @@ -12,7 +12,6 @@ import ( "net" "sync/atomic" "testing" - "time" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" "github.com/stretchr/testify/assert" @@ -27,7 +26,7 @@ type TestCase struct { addr string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { lis, err := net.Listen("tcp", "127.0.0.1:0") require.NoError(t, err) tc.addr = lis.Addr().String() @@ -57,7 +56,7 @@ func (tc *TestCase) Setup(t *testing.T) { }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { var ( interceptedDirect atomic.Bool interceptedChain atomic.Bool @@ -79,9 +78,6 @@ func (tc *TestCase) Run(t *testing.T) { require.NoError(t, err) defer func() { require.NoError(t, conn.Close()) }() - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - defer cancel() - client := helloworld.NewGreeterClient(conn) resp, err := client.SayHello(ctx, &helloworld.HelloRequest{Name: "rob"}) require.NoError(t, err) diff --git a/_integration-tests/tests/ibm_sarama/ibm_sarama.go b/_integration-tests/tests/ibm_sarama/ibm_sarama.go index 0320d93c..e6ae81dd 100644 --- a/_integration-tests/tests/ibm_sarama/ibm_sarama.go +++ b/_integration-tests/tests/ibm_sarama/ibm_sarama.go @@ -34,7 +34,7 @@ type TestCase struct { addrs []string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) tc.cfg = sarama.NewConfig() @@ -46,25 +46,24 @@ func (tc *TestCase) Setup(t *testing.T) { tc.addrs = []string{addr} } -func produceMessage(t *testing.T, addrs []string, cfg *sarama.Config) { +func produceMessage(ctx context.Context, t *testing.T, addrs []string, cfg *sarama.Config) { t.Helper() - var producer sarama.SyncProducer - err := backoff.Retry( - context.Background(), + producer, err := backoff.Retry( + ctx, backoff.NewConstantStrategy(50*time.Millisecond), - func() (err error) { + func() (_ sarama.SyncProducer, err error) { defer func() { - if r := recover(); r != nil && err == nil { - var ok bool - if err, ok = r.(error); !ok { + if r := recover(); r != nil { + if e, ok := r.(error); ok { + err = errors.Join(err, fmt.Errorf("panic: %w", e)) + } else { err = errors.Join(err, fmt.Errorf("panic: %v", r)) } } }() - producer, err = sarama.NewSyncProducer(addrs, cfg) - return err + return sarama.NewSyncProducer(addrs, cfg) }, &backoff.RetryOptions{MaxAttempts: 3}, ) @@ -108,8 +107,8 @@ func consumeMessage(t *testing.T, addrs []string, cfg *sarama.Config) { } } -func (tc *TestCase) Run(t *testing.T) { - produceMessage(t, tc.addrs, tc.cfg) +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + produceMessage(ctx, t, tc.addrs, tc.cfg) consumeMessage(t, tc.addrs, tc.cfg) } diff --git a/_integration-tests/tests/julienschmidt_httprouter/julienschmidt_httprouter.go b/_integration-tests/tests/julienschmidt_httprouter/julienschmidt_httprouter.go index 442c944e..50203c72 100644 --- a/_integration-tests/tests/julienschmidt_httprouter/julienschmidt_httprouter.go +++ b/_integration-tests/tests/julienschmidt_httprouter/julienschmidt_httprouter.go @@ -27,7 +27,7 @@ type TestCase struct { *http.Server } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { router := httprouter.New() router.GET("/ping", func(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) { w.Header().Set("Content-Type", "application/json") @@ -43,13 +43,14 @@ func (tc *TestCase) Setup(t *testing.T) { } go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.Server.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { resp, err := http.Get(fmt.Sprintf("http://%s/ping", tc.Server.Addr)) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/k8s_client_go/base.go b/_integration-tests/tests/k8s_client_go/base.go index 8eebaaab..b5216e4f 100644 --- a/_integration-tests/tests/k8s_client_go/base.go +++ b/_integration-tests/tests/k8s_client_go/base.go @@ -14,7 +14,6 @@ import ( "net/http/httptest" "net/url" "testing" - "time" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" "github.com/stretchr/testify/require" @@ -29,21 +28,17 @@ type base struct { client *kubernetes.Clientset } -func (b *base) setup(t *testing.T) { +func (b *base) setup(_ context.Context, t *testing.T) { b.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte("Hello World")) })) - t.Cleanup(func() { - b.server.Close() - }) + t.Cleanup(func() { b.server.Close() }) tsURL, err := url.Parse(b.server.URL) require.NoError(t, err) b.serverURL = tsURL } -func (b *base) run(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second) - defer cancel() +func (b *base) run(ctx context.Context, t *testing.T) { _, err := b.client.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) // we should get an error here since our test server handler implementation doesn't return what the k8s client expects diff --git a/_integration-tests/tests/k8s_client_go/new_cfg_func.go b/_integration-tests/tests/k8s_client_go/new_cfg_func.go index 8e45296c..44ab215f 100644 --- a/_integration-tests/tests/k8s_client_go/new_cfg_func.go +++ b/_integration-tests/tests/k8s_client_go/new_cfg_func.go @@ -8,6 +8,7 @@ package k8sclientgo import ( + "context" "testing" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" @@ -21,8 +22,8 @@ type TestCaseNewCfgFunc struct { base } -func (tc *TestCaseNewCfgFunc) Setup(t *testing.T) { - tc.base.setup(t) +func (tc *TestCaseNewCfgFunc) Setup(ctx context.Context, t *testing.T) { + tc.base.setup(ctx, t) // internally, this function creates a rest.Config struct literal, so it should get traced by orchestrion. cfg, err := clientcmd.BuildConfigFromKubeconfigGetter(tc.server.URL, func() (*clientcmdapi.Config, error) { @@ -35,8 +36,8 @@ func (tc *TestCaseNewCfgFunc) Setup(t *testing.T) { tc.base.client = client } -func (tc *TestCaseNewCfgFunc) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseNewCfgFunc) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseNewCfgFunc) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/k8s_client_go/struct_literal_with_param.go b/_integration-tests/tests/k8s_client_go/struct_literal_with_param.go index 9c1381da..e51fdd98 100644 --- a/_integration-tests/tests/k8s_client_go/struct_literal_with_param.go +++ b/_integration-tests/tests/k8s_client_go/struct_literal_with_param.go @@ -8,6 +8,7 @@ package k8sclientgo import ( + "context" "net/http" "testing" @@ -23,8 +24,8 @@ type TestCaseStructLiteralWithParam struct { wtCalled bool } -func (tc *TestCaseStructLiteralWithParam) Setup(t *testing.T) { - tc.base.setup(t) +func (tc *TestCaseStructLiteralWithParam) Setup(ctx context.Context, t *testing.T) { + tc.base.setup(ctx, t) cfg := &rest.Config{ Host: tc.server.URL, @@ -39,8 +40,8 @@ func (tc *TestCaseStructLiteralWithParam) Setup(t *testing.T) { tc.base.client = client } -func (tc *TestCaseStructLiteralWithParam) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteralWithParam) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) assert.True(t, tc.wtCalled, "the original WrapTransport function was not called") } diff --git a/_integration-tests/tests/k8s_client_go/struct_literal_without_param.go b/_integration-tests/tests/k8s_client_go/struct_literal_without_param.go index e4f2fc35..4b4b79e4 100644 --- a/_integration-tests/tests/k8s_client_go/struct_literal_without_param.go +++ b/_integration-tests/tests/k8s_client_go/struct_literal_without_param.go @@ -8,6 +8,7 @@ package k8sclientgo import ( + "context" "testing" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" @@ -21,8 +22,8 @@ type TestCaseStructLiteralWithoutParam struct { wtCalled bool } -func (tc *TestCaseStructLiteralWithoutParam) Setup(t *testing.T) { - tc.base.setup(t) +func (tc *TestCaseStructLiteralWithoutParam) Setup(ctx context.Context, t *testing.T) { + tc.base.setup(ctx, t) cfg := &rest.Config{ Host: tc.server.URL, @@ -33,8 +34,8 @@ func (tc *TestCaseStructLiteralWithoutParam) Setup(t *testing.T) { tc.base.client = client } -func (tc *TestCaseStructLiteralWithoutParam) Run(t *testing.T) { - tc.base.run(t) +func (tc *TestCaseStructLiteralWithoutParam) Run(ctx context.Context, t *testing.T) { + tc.base.run(ctx, t) } func (tc *TestCaseStructLiteralWithoutParam) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/logrus/base.go b/_integration-tests/tests/logrus/base.go index 53177bce..b5db7f8d 100644 --- a/_integration-tests/tests/logrus/base.go +++ b/_integration-tests/tests/logrus/base.go @@ -20,8 +20,7 @@ import ( "datadoghq.dev/orchestrion/_integration-tests/validator/trace" ) -func runTest(t *testing.T, out *bytes.Buffer, logFn func(context.Context, logrus.Level, string)) { - ctx := context.Background() +func runTest(ctx context.Context, t *testing.T, out *bytes.Buffer, logFn func(context.Context, logrus.Level, string)) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() diff --git a/_integration-tests/tests/logrus/global_logger.go b/_integration-tests/tests/logrus/global_logger.go index 5b90f0d4..5e9cb86a 100644 --- a/_integration-tests/tests/logrus/global_logger.go +++ b/_integration-tests/tests/logrus/global_logger.go @@ -21,14 +21,14 @@ type TestCaseGlobalLogger struct { logs *bytes.Buffer } -func (tc *TestCaseGlobalLogger) Setup(*testing.T) { +func (tc *TestCaseGlobalLogger) Setup(context.Context, *testing.T) { tc.logs = new(bytes.Buffer) logrus.SetLevel(logrus.DebugLevel) logrus.SetOutput(tc.logs) } -func (tc *TestCaseGlobalLogger) Run(t *testing.T) { - runTest(t, tc.logs, tc.Log) +func (tc *TestCaseGlobalLogger) Run(ctx context.Context, t *testing.T) { + runTest(ctx, t, tc.logs, tc.Log) } func (*TestCaseGlobalLogger) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/logrus/new_logger.go b/_integration-tests/tests/logrus/new_logger.go index b9d55c94..c464a9f6 100644 --- a/_integration-tests/tests/logrus/new_logger.go +++ b/_integration-tests/tests/logrus/new_logger.go @@ -22,15 +22,15 @@ type TestCaseNewLogger struct { logs *bytes.Buffer } -func (tc *TestCaseNewLogger) Setup(*testing.T) { +func (tc *TestCaseNewLogger) Setup(context.Context, *testing.T) { tc.logs = new(bytes.Buffer) tc.logger = logrus.New() tc.logger.SetLevel(logrus.DebugLevel) tc.logger.SetOutput(tc.logs) } -func (tc *TestCaseNewLogger) Run(t *testing.T) { - runTest(t, tc.logs, tc.Log) +func (tc *TestCaseNewLogger) Run(ctx context.Context, t *testing.T) { + runTest(ctx, t, tc.logs, tc.Log) } func (*TestCaseNewLogger) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/logrus/struct_literal_ptr.go b/_integration-tests/tests/logrus/struct_literal_ptr.go index 467d291a..c94c62a8 100644 --- a/_integration-tests/tests/logrus/struct_literal_ptr.go +++ b/_integration-tests/tests/logrus/struct_literal_ptr.go @@ -23,7 +23,7 @@ type TestCaseStructLiteralPtr struct { logs *bytes.Buffer } -func (tc *TestCaseStructLiteralPtr) Setup(*testing.T) { +func (tc *TestCaseStructLiteralPtr) Setup(context.Context, *testing.T) { tc.logs = new(bytes.Buffer) tc.logger = &logrus.Logger{ Out: os.Stderr, @@ -37,8 +37,8 @@ func (tc *TestCaseStructLiteralPtr) Setup(*testing.T) { tc.logger.SetOutput(tc.logs) } -func (tc *TestCaseStructLiteralPtr) Run(t *testing.T) { - runTest(t, tc.logs, tc.Log) +func (tc *TestCaseStructLiteralPtr) Run(ctx context.Context, t *testing.T) { + runTest(ctx, t, tc.logs, tc.Log) } func (*TestCaseStructLiteralPtr) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/logrus/struct_literal_val.go b/_integration-tests/tests/logrus/struct_literal_val.go index b0b31ad4..9822d1b2 100644 --- a/_integration-tests/tests/logrus/struct_literal_val.go +++ b/_integration-tests/tests/logrus/struct_literal_val.go @@ -23,7 +23,7 @@ type TestCaseStructLiteralVal struct { logs *bytes.Buffer } -func (tc *TestCaseStructLiteralVal) Setup(*testing.T) { +func (tc *TestCaseStructLiteralVal) Setup(context.Context, *testing.T) { tc.logs = new(bytes.Buffer) tc.logger = logrus.Logger{ Out: os.Stderr, @@ -37,8 +37,8 @@ func (tc *TestCaseStructLiteralVal) Setup(*testing.T) { tc.logger.SetOutput(tc.logs) } -func (tc *TestCaseStructLiteralVal) Run(t *testing.T) { - runTest(t, tc.logs, tc.Log) +func (tc *TestCaseStructLiteralVal) Run(ctx context.Context, t *testing.T) { + runTest(ctx, t, tc.logs, tc.Log) } func (*TestCaseStructLiteralVal) ExpectedTraces() trace.Traces { diff --git a/_integration-tests/tests/mongo/mongo.go b/_integration-tests/tests/mongo/mongo.go index 858f0e6a..f8bfc136 100644 --- a/_integration-tests/tests/mongo/mongo.go +++ b/_integration-tests/tests/mongo/mongo.go @@ -30,11 +30,9 @@ type TestCase struct { *mongo.Client } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(ctx context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) - ctx := context.Background() - var err error tc.server, err = testmongo.Run(ctx, "mongo:6", @@ -51,18 +49,18 @@ func (tc *TestCase) Setup(t *testing.T) { opts := options.Client() opts.ApplyURI(mongoURI) - client, err := mongo.Connect(context.Background(), opts) + client, err := mongo.Connect(ctx, opts) require.NoError(t, err) tc.Client = client t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.Client.Disconnect(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { - ctx := context.Background() +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() diff --git a/_integration-tests/tests/net_http/base.go b/_integration-tests/tests/net_http/base.go index d81ce249..5c65362a 100644 --- a/_integration-tests/tests/net_http/base.go +++ b/_integration-tests/tests/net_http/base.go @@ -26,7 +26,7 @@ type base struct { handler http.Handler } -func (b *base) Setup(t *testing.T) { +func (b *base) Setup(_ context.Context, t *testing.T) { b.srv = &http.Server{ Addr: "127.0.0.1:" + utils.GetFreePort(t), ReadTimeout: 5 * time.Second, @@ -36,13 +36,14 @@ func (b *base) Setup(t *testing.T) { go func() { assert.ErrorIs(t, b.srv.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, b.srv.Shutdown(ctx)) }) } -func (b *base) Run(t *testing.T) { +func (b *base) Run(_ context.Context, t *testing.T) { resp, err := http.Get(fmt.Sprintf("http://%s/", b.srv.Addr)) require.NoError(t, err) require.Equal(t, http.StatusOK, resp.StatusCode) diff --git a/_integration-tests/tests/net_http/client_error.go b/_integration-tests/tests/net_http/client_error.go index f3ded49c..3180629c 100644 --- a/_integration-tests/tests/net_http/client_error.go +++ b/_integration-tests/tests/net_http/client_error.go @@ -24,7 +24,7 @@ type TestCaseClientError struct { handler http.Handler } -func (b *TestCaseClientError) Setup(t *testing.T) { +func (b *TestCaseClientError) Setup(_ context.Context, t *testing.T) { b.srv = &http.Server{ Addr: "127.0.0.1:" + utils.GetFreePort(t), ReadTimeout: 5 * time.Second, @@ -36,13 +36,14 @@ func (b *TestCaseClientError) Setup(t *testing.T) { go func() { assert.ErrorIs(t, b.srv.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, b.srv.Shutdown(ctx)) }) } -func (b *TestCaseClientError) Run(t *testing.T) { +func (b *TestCaseClientError) Run(_ context.Context, t *testing.T) { resp, err := http.Get(fmt.Sprintf("http://%s/", b.srv.Addr)) require.NoError(t, err) require.Equal(t, http.StatusTeapot, resp.StatusCode) diff --git a/_integration-tests/tests/net_http/func_handler.go b/_integration-tests/tests/net_http/func_handler.go index 727c2385..1ccdce18 100644 --- a/_integration-tests/tests/net_http/func_handler.go +++ b/_integration-tests/tests/net_http/func_handler.go @@ -8,6 +8,7 @@ package nethttp import ( + "context" "net/http" "testing" ) @@ -16,7 +17,7 @@ type TestCaseFuncHandler struct { base } -func (tc *TestCaseFuncHandler) Setup(t *testing.T) { +func (tc *TestCaseFuncHandler) Setup(ctx context.Context, t *testing.T) { tc.handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case "/": @@ -33,5 +34,5 @@ func (tc *TestCaseFuncHandler) Setup(t *testing.T) { } }) - tc.base.Setup(t) + tc.base.Setup(ctx, t) } diff --git a/_integration-tests/tests/net_http/handler_implementation.go b/_integration-tests/tests/net_http/handler_implementation.go index c55e6afa..25bc9a39 100644 --- a/_integration-tests/tests/net_http/handler_implementation.go +++ b/_integration-tests/tests/net_http/handler_implementation.go @@ -8,6 +8,7 @@ package nethttp import ( + "context" "net/http" "testing" ) @@ -37,10 +38,10 @@ type TestCaseHandlerImplementation struct { base } -func (tc *TestCaseHandlerImplementation) Setup(t *testing.T) { +func (tc *TestCaseHandlerImplementation) Setup(ctx context.Context, t *testing.T) { tc.handler = &customHandler{ handleRoot: tc.handleRoot, handleHit: tc.handleHit, } - tc.base.Setup(t) + tc.base.Setup(ctx, t) } diff --git a/_integration-tests/tests/net_http/issue_400.go b/_integration-tests/tests/net_http/issue_400.go index db5eb836..be48d02c 100644 --- a/_integration-tests/tests/net_http/issue_400.go +++ b/_integration-tests/tests/net_http/issue_400.go @@ -8,6 +8,7 @@ package nethttp import ( + "context" "net/http" "testing" ) @@ -27,7 +28,7 @@ func wrapCustomType(f func(http.ResponseWriter, *http.Request)) handlerFunc { } } -func (tc *TestCaseIssue400) Setup(t *testing.T) { +func (tc *TestCaseIssue400) Setup(ctx context.Context, t *testing.T) { handleHit := wrapCustomType(tc.handleHit) handleRoot := wrapCustomType(tc.handleRoot) mux := http.NewServeMux() @@ -35,5 +36,5 @@ func (tc *TestCaseIssue400) Setup(t *testing.T) { mux.HandleFunc("/", handleRoot) tc.handler = mux - tc.base.Setup(t) + tc.base.Setup(ctx, t) } diff --git a/_integration-tests/tests/net_http/serve_mux_handler.go b/_integration-tests/tests/net_http/serve_mux_handler.go index 8f7e9d54..d6f5e4d3 100644 --- a/_integration-tests/tests/net_http/serve_mux_handler.go +++ b/_integration-tests/tests/net_http/serve_mux_handler.go @@ -8,6 +8,7 @@ package nethttp import ( + "context" "net/http" "testing" ) @@ -16,18 +17,18 @@ type TestCaseServeMuxHandler struct { base } -func (tc *TestCaseServeMuxHandler) Setup(t *testing.T) { +func (tc *TestCaseServeMuxHandler) Setup(ctx context.Context, t *testing.T) { tc.handler = tc.serveMuxHandler() - tc.base.Setup(t) + tc.base.Setup(ctx, t) } type TestCaseHandlerIsNil struct { base } -func (tc *TestCaseHandlerIsNil) Setup(t *testing.T) { +func (tc *TestCaseHandlerIsNil) Setup(ctx context.Context, t *testing.T) { http.HandleFunc("/hit", tc.base.handleHit) http.HandleFunc("/", tc.base.handleRoot) tc.base.handler = nil // Set handler to nil to test http.DefaultServeMux - tc.base.Setup(t) + tc.base.Setup(ctx, t) } diff --git a/_integration-tests/tests/os/lfi.go b/_integration-tests/tests/os/lfi.go index db6aa101..c031670a 100644 --- a/_integration-tests/tests/os/lfi.go +++ b/_integration-tests/tests/os/lfi.go @@ -30,7 +30,7 @@ type TestCase struct { *testing.T } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { if runtime.GOOS == "windows" { t.Skip("appsec does not support Windows") } @@ -52,13 +52,14 @@ func (tc *TestCase) Setup(t *testing.T) { go func() { assert.ErrorIs(t, tc.Server.ListenAndServe(), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() require.NoError(t, tc.Server.Shutdown(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { tc.T = t resp, err := http.Get(fmt.Sprintf("http://%s/?path=/etc/passwd", tc.Server.Addr)) require.NoError(t, err) @@ -96,12 +97,12 @@ func (*TestCase) ExpectedTraces() trace.Traces { } } -func (tc *TestCase) handleRoot(w http.ResponseWriter, _ *http.Request) { +func (tc *TestCase) handleRoot(w http.ResponseWriter, r *http.Request) { fp, err := os.Open("/etc/passwd") assert.ErrorIs(tc.T, err, &events.BlockingSecurityEvent{}) - if events.IsSecurityError(err) { // TODO: response writer instrumentation to not have to do that - span, _ := tracer.SpanFromContext(context.TODO()) + if events.IsSecurityError(err) { // TODO: response writer instrumentation do not have to do that + span, _ := tracer.SpanFromContext(r.Context()) span.SetTag("is.security.error", true) return } diff --git a/_integration-tests/tests/pgx/pgx.go b/_integration-tests/tests/pgx/pgx.go index efc988cd..374a6067 100644 --- a/_integration-tests/tests/pgx/pgx.go +++ b/_integration-tests/tests/pgx/pgx.go @@ -28,11 +28,9 @@ type TestCase struct { conn *pgx.Conn } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(ctx context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) - ctx := context.Background() - var err error tc.container, err = testpostgres.Run(ctx, "docker.io/postgres:16-alpine", @@ -53,14 +51,14 @@ func (tc *TestCase) Setup(t *testing.T) { tc.conn, err = pgx.Connect(ctx, dbURL) require.NoError(t, err) t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.conn.Close(ctx)) }) } -func (tc *TestCase) Run(t *testing.T) { - ctx := context.Background() +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() diff --git a/_integration-tests/tests/redigo/redigo.go b/_integration-tests/tests/redigo/redigo.go index fce2c870..dbc54311 100644 --- a/_integration-tests/tests/redigo/redigo.go +++ b/_integration-tests/tests/redigo/redigo.go @@ -14,6 +14,7 @@ import ( "time" "datadoghq.dev/orchestrion/_integration-tests/utils" + "datadoghq.dev/orchestrion/_integration-tests/utils/backoff" "datadoghq.dev/orchestrion/_integration-tests/validator/trace" "github.com/gomodule/redigo/redis" "github.com/google/uuid" @@ -29,7 +30,7 @@ type TestCase struct { key string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) uuid, err := uuid.NewRandom() @@ -55,20 +56,23 @@ func (tc *TestCase) Setup(t *testing.T) { return err }, } - t.Cleanup(func() { - assert.NoError(t, tc.Pool.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.Pool.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - span, ctx := tracer.StartSpanFromContext(context.Background(), "test.root") +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() client, err := tc.Pool.GetContext(ctx) require.NoError(t, err) defer func() { assert.NoError(t, client.Close()) }() - _, err = client.Do("SET", tc.key, "test_value") + _, err = backoff.Retry( + ctx, + backoff.NewExponentialStrategy(100*time.Millisecond, 2, time.Second), + func() (any, error) { return client.Do("SET", tc.key, "test_value") }, + nil, + ) require.NoError(t, err) res, err := client.Do("GET", tc.key, ctx) diff --git a/_integration-tests/tests/segmentio_kafka.v0/segmentio_kafka.go b/_integration-tests/tests/segmentio_kafka.v0/segmentio_kafka.go index 6fed60d1..34128f75 100644 --- a/_integration-tests/tests/segmentio_kafka.v0/segmentio_kafka.go +++ b/_integration-tests/tests/segmentio_kafka.v0/segmentio_kafka.go @@ -35,7 +35,7 @@ type TestCase struct { writer *kafka.Writer } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) tc.kafka, tc.addr = utils.StartKafkaTestContainer(t) @@ -56,15 +56,12 @@ func (tc *TestCase) newReader(topic string) *kafka.Reader { }) } -func (tc *TestCase) Run(t *testing.T) { - tc.produce(t) - tc.consume(t) +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + tc.produce(ctx, t) + tc.consume(ctx, t) } -func (tc *TestCase) produce(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - +func (tc *TestCase) produce(ctx context.Context, t *testing.T) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() @@ -85,7 +82,7 @@ func (tc *TestCase) produce(t *testing.T) { Value: []byte("Third message"), }, } - err := backoff.Retry( + err := backoff.RetryVoid( ctx, backoff.NewExponentialStrategy(100*time.Millisecond, 2, 5*time.Second), func() error { return tc.writer.WriteMessages(ctx, messages...) }, @@ -104,10 +101,7 @@ func (tc *TestCase) produce(t *testing.T) { require.NoError(t, tc.writer.Close()) } -func (tc *TestCase) consume(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - +func (tc *TestCase) consume(ctx context.Context, t *testing.T) { readerA := tc.newReader(topicA) m, err := readerA.ReadMessage(ctx) require.NoError(t, err) diff --git a/_integration-tests/tests/shopify_sarama/shopify_sarama.go b/_integration-tests/tests/shopify_sarama/shopify_sarama.go index 59e169c5..01e2254b 100644 --- a/_integration-tests/tests/shopify_sarama/shopify_sarama.go +++ b/_integration-tests/tests/shopify_sarama/shopify_sarama.go @@ -8,6 +8,7 @@ package shopify_sarama import ( + "context" "testing" "time" @@ -30,7 +31,7 @@ type TestCase struct { addrs []string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) tc.cfg = sarama.NewConfig() @@ -85,7 +86,7 @@ func consumeMessage(t *testing.T, addrs []string, cfg *sarama.Config) { } } -func (tc *TestCase) Run(t *testing.T) { +func (tc *TestCase) Run(_ context.Context, t *testing.T) { produceMessage(t, tc.addrs, tc.cfg) consumeMessage(t, tc.addrs, tc.cfg) } diff --git a/_integration-tests/tests/slog/slog.go b/_integration-tests/tests/slog/slog.go index 29e70722..0b50e327 100644 --- a/_integration-tests/tests/slog/slog.go +++ b/_integration-tests/tests/slog/slog.go @@ -24,7 +24,7 @@ type TestCase struct { logs *bytes.Buffer } -func (tc *TestCase) Setup(*testing.T) { +func (tc *TestCase) Setup(context.Context, *testing.T) { tc.logs = new(bytes.Buffer) tc.logger = slog.New( slog.NewTextHandler( @@ -39,12 +39,12 @@ func Log(ctx context.Context, f func(context.Context, string, ...any), msg strin f(ctx, msg) } -func (tc *TestCase) Run(t *testing.T) { - Log(context.Background(), tc.logger.DebugContext, "debug") - Log(context.Background(), tc.logger.InfoContext, "info") - Log(context.Background(), tc.logger.WarnContext, "warn") - Log(context.Background(), tc.logger.ErrorContext, "error") - Log(context.Background(), func(ctx context.Context, s string, a ...any) { +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + Log(ctx, tc.logger.DebugContext, "debug") + Log(ctx, tc.logger.InfoContext, "info") + Log(ctx, tc.logger.WarnContext, "warn") + Log(ctx, tc.logger.ErrorContext, "error") + Log(ctx, func(ctx context.Context, s string, a ...any) { tc.logger.Log(ctx, slog.LevelInfo, s, a...) }, "log") diff --git a/_integration-tests/tests/sql/sql.go b/_integration-tests/tests/sql/sql.go index ca044691..86d37263 100644 --- a/_integration-tests/tests/sql/sql.go +++ b/_integration-tests/tests/sql/sql.go @@ -27,7 +27,7 @@ type TestCase struct { untraced *sql.DB } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(ctx context.Context, t *testing.T) { const ( dn = "sqlite3" dsn = "file::memory:?cache=shared" @@ -40,8 +40,6 @@ func (tc *TestCase) Setup(t *testing.T) { require.NoError(t, err) t.Cleanup(func() { require.NoError(t, tc.untraced.Close()) }) - ctx := context.Background() - _, err = tc.untraced.ExecContext(ctx, `CREATE TABLE IF NOT EXISTS notes ( id INTEGER PRIMARY KEY AUTOINCREMENT, @@ -64,13 +62,11 @@ func (tc *TestCase) Setup(t *testing.T) { tc.DB, err = sql.Open(dn, dsn) require.NoError(t, err) - t.Cleanup(func() { - assert.NoError(t, tc.DB.Close()) - }) + t.Cleanup(func() { assert.NoError(t, tc.DB.Close()) }) } -func (tc *TestCase) Run(t *testing.T) { - _, err := tc.DB.ExecContext(context.Background(), +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { + _, err := tc.DB.ExecContext(ctx, `INSERT INTO notes (userid, content, created) VALUES (?, ?, datetime('now'));`, 1337, "This is Elite!") require.NoError(t, err) diff --git a/_integration-tests/tests/twirp/twirp.go b/_integration-tests/tests/twirp/twirp.go index bda2cd83..03df8515 100644 --- a/_integration-tests/tests/twirp/twirp.go +++ b/_integration-tests/tests/twirp/twirp.go @@ -28,7 +28,7 @@ type TestCase struct { addr string } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(_ context.Context, t *testing.T) { lis, err := net.Listen("tcp", "127.0.0.1:0") require.NoError(t, err) @@ -40,7 +40,8 @@ func (tc *TestCase) Setup(t *testing.T) { assert.ErrorIs(t, tc.srv.Serve(lis), http.ErrServerClosed) }() t.Cleanup(func() { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + // Using a new 10s-timeout context, as we may be running cleanup after the original context expired. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() assert.NoError(t, tc.srv.Shutdown(ctx)) }) @@ -48,8 +49,7 @@ func (tc *TestCase) Setup(t *testing.T) { tc.client = example.NewHaberdasherJSONClient(tc.addr, http.DefaultClient) } -func (tc *TestCase) Run(t *testing.T) { - ctx := context.Background() +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { _, err := tc.client.MakeHat(ctx, &example.Size{Inches: 6}) require.NoError(t, err) } diff --git a/_integration-tests/tests/vault/vault.go b/_integration-tests/tests/vault/vault.go index f2c05de0..e979dcea 100644 --- a/_integration-tests/tests/vault/vault.go +++ b/_integration-tests/tests/vault/vault.go @@ -25,11 +25,9 @@ type TestCase struct { *api.Client } -func (tc *TestCase) Setup(t *testing.T) { +func (tc *TestCase) Setup(ctx context.Context, t *testing.T) { utils.SkipIfProviderIsNotHealthy(t) - ctx := context.Background() - var err error tc.server, err = testvault.Run(ctx, "vault:1.7.3", @@ -55,8 +53,7 @@ func (tc *TestCase) Setup(t *testing.T) { tc.Client = c } -func (tc *TestCase) Run(t *testing.T) { - ctx := context.Background() +func (tc *TestCase) Run(ctx context.Context, t *testing.T) { span, ctx := tracer.StartSpanFromContext(ctx, "test.root") defer span.Finish() diff --git a/_integration-tests/utils/backoff/backoff.go b/_integration-tests/utils/backoff/backoff.go index f983cb48..a979d698 100644 --- a/_integration-tests/utils/backoff/backoff.go +++ b/_integration-tests/utils/backoff/backoff.go @@ -50,19 +50,41 @@ type RetryOptions struct { Sleep func(time.Duration) } -// Retry makes up to [RetryOptions.MaxAttempts] at calling the [action] +// RetryVoid makes up to [RetryOptions.MaxAttempts] at calling the [action] // function. It uses the [Strategy] to determine how much time to wait between // attempts. The [RetryOptions.ShouldRetry] function is called with all // non-[nil] errors returned by [action], the attempt number, and the delay // before the next attempt. If it returns [true], the [RetryOptions.Sleep] // function is called with the delay, and the next attempt is made. Otherwise, -// [Retry] returns immediately. -func Retry( +// [RetryVoid] returns immediately. +func RetryVoid( ctx context.Context, strategy Strategy, action func() error, opts *RetryOptions, ) error { + _, err := Retry( + ctx, + strategy, + func() (any, error) { return nil, action() }, + opts, + ) + return err +} + +// Retry makes up to [RetryOptions.MaxAttempts] at calling the [action] +// function. It uses the [Strategy] to determine how much time to wait between +// attempts. The [RetryOptions.ShouldRetry] function is called with all +// non-[nil] errors returned by [action], the attempt number, and the delay +// before the next attempt. If it returns [true], the [RetryOptions.Sleep] +// function is called with the delay, and the next attempt is made. Otherwise, +// [Retry] returns immediately. +func Retry[T any]( + ctx context.Context, + strategy Strategy, + action func() (T, error), + opts *RetryOptions, +) (T, error) { var ( maxAttempts = defaultMaxAttempts shouldRetry = RetryAllErrors @@ -88,10 +110,10 @@ func Retry( sleep(delay) } - err := action() + res, err := action() if err == nil { // Success! - return nil + return res, nil } // Accumulate this error on top of the others we have observed so far. @@ -101,5 +123,6 @@ func Retry( break } } - return errors.Join(errs, ctx.Err()) + var zero T + return zero, errors.Join(errs, ctx.Err()) } diff --git a/_integration-tests/utils/backoff/backoff_test.go b/_integration-tests/utils/backoff/backoff_test.go index 9a3a5e88..f8a9e372 100644 --- a/_integration-tests/utils/backoff/backoff_test.go +++ b/_integration-tests/utils/backoff/backoff_test.go @@ -48,7 +48,7 @@ func TestRetry(t *testing.T) { delays = append(delays, d) } - err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, Sleep: timeSleep}) + err := RetryVoid(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, Sleep: timeSleep}) require.Error(t, err) assert.Equal(t, delaySequence, delays) for _, expectedErr := range expectedErrs { @@ -74,7 +74,7 @@ func TestRetry(t *testing.T) { delays = append(delays, d) } - err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, ShouldRetry: shouldRetry, Sleep: timeSleep}) + err := RetryVoid(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, ShouldRetry: shouldRetry, Sleep: timeSleep}) require.Error(t, err) // We hit the non-retryable error at the 3rd attempt. assert.Equal(t, delaySequence[:2], delays) @@ -109,7 +109,7 @@ func TestRetry(t *testing.T) { } } - err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, Sleep: timeSleep}) + err := RetryVoid(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, Sleep: timeSleep}) require.Error(t, err) // We reach the 1 second total waited during the 4th back-off. assert.Equal(t, delaySequence[:4], delays) @@ -123,21 +123,22 @@ func TestRetry(t *testing.T) { ctx := context.Background() strategy := NewConstantStrategy(100 * time.Millisecond) var attempts int - action := func() error { + action := func() (int, error) { attempts++ // At least 20 errors, then flip a coin... but no more than 100 attempts. if attempts < 20 || (attempts < 100 && rand.Int()%2 == 0) { - return fmt.Errorf("Error number %d", attempts) + return -1, fmt.Errorf("Error number %d", attempts) } - return nil + return attempts, nil } var delayCount int timeSleep := func(time.Duration) { delayCount++ } - err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: -1, Sleep: timeSleep}) + res, err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: -1, Sleep: timeSleep}) require.NoError(t, err) + assert.Equal(t, attempts, res) // We should have waited as many times as we attempted, except for the initial attempt. assert.Equal(t, delayCount, attempts-1) }) @@ -147,14 +148,15 @@ func TestRetry(t *testing.T) { strategy := NewExponentialStrategy(100*time.Millisecond, 2, 5*time.Second) maxAttempts := 10 shouldRetry := func(error, int, time.Duration) bool { return false } - action := func() error { return nil } + action := func() (int, error) { return 1337, nil } delays := make([]time.Duration, 0, maxAttempts) timeSleep := func(d time.Duration) { delays = append(delays, d) } - err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, ShouldRetry: shouldRetry, Sleep: timeSleep}) + res, err := Retry(ctx, strategy, action, &RetryOptions{MaxAttempts: maxAttempts, ShouldRetry: shouldRetry, Sleep: timeSleep}) require.NoError(t, err) + assert.Equal(t, 1337, res) assert.Empty(t, delays) }) } diff --git a/_integration-tests/utils/suite.go b/_integration-tests/utils/suite.go index 0b12f139..d857f51d 100644 --- a/_integration-tests/utils/suite.go +++ b/_integration-tests/utils/suite.go @@ -6,6 +6,7 @@ package utils import ( + "context" "testing" "datadoghq.dev/orchestrion/_integration-tests/utils/agent" @@ -25,7 +26,7 @@ type TestCase interface { // are not satisfied by the test environment. // // The tracer is not yet started when Setup is executed. - Setup(*testing.T) + Setup(context.Context, *testing.T) // Run executes the test case after starting the tracer. This should perform // the necessary calls to produce trace information from injected @@ -33,7 +34,7 @@ type TestCase interface { // is expected to be successful, database call does not error out, etc...). // The tracer is shut down after the Run function returns, ensuring // outstanding spans are flushed to the agent. - Run(*testing.T) + Run(context.Context, *testing.T) // ExpectedTraces returns a trace.Traces object describing all traces expected // to be produced by the [TestCase.Run] function. There should be one entry @@ -51,14 +52,21 @@ func RunTest(t *testing.T, tc TestCase) { require.NoError(t, err, "failed to start mock agent") defer mockAgent.Close() + ctx := context.Background() + if deadline, ok := t.Deadline(); ok { + var cancel context.CancelFunc + ctx, cancel = context.WithDeadline(context.Background(), deadline) + defer cancel() + } + t.Log("Running setup") - tc.Setup(t) + tc.Setup(ctx, t) sess, err := mockAgent.NewSession(t) require.NoError(t, err, "failed to create a new mock agent session") t.Log("Running test") - tc.Run(t) + tc.Run(ctx, t) checkTraces(t, tc, sess) } diff --git a/internal/injector/check.go b/internal/injector/check.go index 1a76dd01..23d4e40b 100644 --- a/internal/injector/check.go +++ b/internal/injector/check.go @@ -41,11 +41,35 @@ func (i *Injector) typeCheck(fset *token.FileSet, files []parse.File) (types.Inf // This is a workaround for the fact that the Go type checker does not return a specific unexported error type // TODO: Ask better error typing from the Go team for the go/types package if strings.Contains(err.Error(), "package requires newer Go version") { + // Not returning a type-checking error here, as this error we want to surface directly to the user ourselves. return types.Info{}, fmt.Errorf("orchestrion was built with Go version %s but package %q requires a newer go version, please reinstall and pin orchestrion with a newer Go version: type-checking files: %w", runtime.Version(), i.ImportPath, err) } - return types.Info{}, fmt.Errorf("type-checking files: %w", err) + return types.Info{}, typeCheckingError{cause: err} } return typeInfo, nil } + +type typeCheckingError struct { + cause error +} + +var _ error = typeCheckingError{} + +func (e typeCheckingError) Error() string { + return fmt.Sprintf("type-checking files: %v", e.cause) +} + +func (typeCheckingError) Is(target error) bool { + switch target.(type) { + case typeCheckingError: + return true + default: + return false + } +} + +func (e typeCheckingError) Unwrap() error { + return e.cause +} diff --git a/internal/injector/injector.go b/internal/injector/injector.go index 975f5ffb..38e0b571 100644 --- a/internal/injector/injector.go +++ b/internal/injector/injector.go @@ -102,7 +102,12 @@ func (i *Injector) InjectFiles(files []string, aspects []*aspect.Aspect) (map[st } typeInfo, err := i.typeCheck(fset, parsedFiles) - if err != nil { + if errors.Is(err, typeCheckingError{}) { + // We don't want to fail here on type-checking errors... Instead do nothing and let the standard + // go compiler/toolchain surface the error to the user in a canonical way. + log.Warnf("Skipping injectrion in %s due to: %v\n", i.ImportPath, err) + return nil, context.GoLangVersion{}, nil + } else if err != nil { return nil, context.GoLangVersion{}, err } diff --git a/samples/go.mod b/samples/go.mod index b9ff65e8..c35a1deb 100644 --- a/samples/go.mod +++ b/samples/go.mod @@ -5,16 +5,16 @@ go 1.22.10 replace github.com/DataDog/orchestrion => ../ require ( - github.com/99designs/gqlgen v0.17.60 + github.com/99designs/gqlgen v0.17.61 github.com/DataDog/orchestrion v0.0.0-00010101000000-000000000000 github.com/IBM/sarama v1.43.3 github.com/Shopify/sarama v1.38.1 github.com/aws/aws-sdk-go v1.55.5 - github.com/aws/aws-sdk-go-v2 v1.32.6 - github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 github.com/elastic/go-elasticsearch/v6 v6.8.10 github.com/elastic/go-elasticsearch/v7 v7.17.10 - github.com/elastic/go-elasticsearch/v8 v8.16.0 + github.com/elastic/go-elasticsearch/v8 v8.17.0 github.com/gin-gonic/gin v1.10.0 github.com/go-chi/chi/v5 v5.2.0 github.com/go-redis/redis v6.15.9+incompatible @@ -24,16 +24,16 @@ require ( github.com/gofiber/fiber/v2 v2.52.5 github.com/gomodule/redigo v1.9.2 github.com/hashicorp/vault/api v1.15.0 - github.com/jackc/pgx/v5 v5.7.1 + github.com/jackc/pgx/v5 v5.7.2 github.com/jinzhu/gorm v1.9.16 - github.com/labstack/echo/v4 v4.13.2 + github.com/labstack/echo/v4 v4.13.3 github.com/mattn/go-sqlite3 v1.14.24 github.com/redis/go-redis/v9 v9.7.0 github.com/sirupsen/logrus v1.9.3 github.com/twitchtv/twirp v8.1.3+incompatible github.com/vektah/gqlparser/v2 v2.5.20 go.mongodb.org/mongo-driver v1.17.1 - google.golang.org/grpc v1.69.0 + google.golang.org/grpc v1.69.2 gorm.io/driver/postgres v1.5.11 gorm.io/gorm v1.25.12 ) @@ -61,17 +61,17 @@ require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.45 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 // indirect github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0 // indirect github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 // indirect github.com/aws/aws-sdk-go-v2/service/kinesis v1.32.7 // indirect github.com/aws/aws-sdk-go-v2/service/sfn v1.34.1 // indirect github.com/aws/aws-sdk-go-v2/service/sns v1.33.7 // indirect @@ -219,7 +219,7 @@ require ( golang.org/x/arch v0.12.0 // indirect golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.24.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect @@ -228,8 +228,8 @@ require ( golang.org/x/time v0.8.0 // indirect golang.org/x/tools v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect - google.golang.org/protobuf v1.35.2 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect + google.golang.org/protobuf v1.36.0 // indirect gopkg.in/DataDog/dd-trace-go.v1 v1.71.0-rc.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/samples/go.sum b/samples/go.sum index 5128157d..f9d305ed 100644 --- a/samples/go.sum +++ b/samples/go.sum @@ -1,7 +1,7 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/99designs/gqlgen v0.17.60 h1:xxl7kQDCNw79itzWQtCUSXgkovCyq9r+ogSXfZpKPYM= -github.com/99designs/gqlgen v0.17.60/go.mod h1:vQJzWXyGya2TYL7cig1G4OaCQzyck031MgYBlUwaI9I= +github.com/99designs/gqlgen v0.17.61 h1:vE7xLRC066n9wehgjeplILOWtwz75zbzcV2/Iv9i3pw= +github.com/99designs/gqlgen v0.17.61/go.mod h1:rFU1T3lhv/tPeAlww/DJ4ol2YxT/pPpue+xxPbkd3r4= github.com/DataDog/appsec-internal-go v1.9.0 h1:cGOneFsg0JTRzWl5U2+og5dbtyW3N8XaYwc5nXe39Vw= github.com/DataDog/appsec-internal-go v1.9.0/go.mod h1:wW0cRfWBo4C044jHGwYiyh5moQV2x0AhnwqMuiX7O/g= github.com/DataDog/datadog-agent/pkg/obfuscate v0.59.1 h1:I9lNFJ9dwvoEmz4US9JM8mNqibUKG7x2OjB8itZObao= @@ -53,8 +53,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= -github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= github.com/aws/aws-sdk-go-v2/config v1.28.4 h1:qgD0MKmkIzZR2DrAjWJcI9UkndjR+8f6sjUQvXh0mb0= @@ -63,14 +63,14 @@ github.com/aws/aws-sdk-go-v2/credentials v1.17.45 h1:DUgm5lFso57E7150RBgu1JpVQoF github.com/aws/aws-sdk-go-v2/credentials v1.17.45/go.mod h1:dnBpENcPC1ekZrGpSWspX+ZRGzhkvqngT2Qp5xBR1dY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 h1:woXadbf0c7enQ2UGCi8gW/WuKmE0xIzxBF/eD94jMKQ= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19/go.mod h1:zminj5ucw7w0r65bP6nhyOd3xL6veAUMc3ElGMoLVb4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25 h1:r67ps7oHCYnflpgDy2LZU0MAQtQbYIOqNNnqGO6xQkE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.25/go.mod h1:GrGY+Q4fIokYLtjCVB/aFfCVL6hhGUFl8inD18fDalE= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0 h1:isKhHsjpQR3CypQJ4G1g8QWx7zNpiC/xKw1zjgJYVno= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.38.0/go.mod h1:xDvUyIkwBwNtVZJdHEwAuhFly3mezwdEWkbJ5oNYwIw= github.com/aws/aws-sdk-go-v2/service/ec2 v1.93.2 h1:c6a19AjfhEXKlEX63cnlWtSQ4nzENihHZOG0I3wH6BE= @@ -79,18 +79,18 @@ github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.0 h1:UBCwgevYbPDbPb8LKyCm github.com/aws/aws-sdk-go-v2/service/eventbridge v1.36.0/go.mod h1:ve9wzd6ToYjkZrF0nesNJxy14kU77QjrH5Rixrr4NJY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6 h1:HCpPsWqmYQieU7SS6E9HXfdAMSud0pteVXieJmcpIRI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.6/go.mod h1:ngUiVRCco++u+soRRVBIvBZxSMMvOVMXA4PJ36JLfSw= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.6 h1:nbmKXZzXPJn41CcD4HsHsGWqvKjLKz9kWu6XxvLmf1s= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.10.6/go.mod h1:SJhcisfKfAawsdNQoZMBEjg+vyN2lH6rO6fP+T94z5Y= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6 h1:BbGDtTi0T1DYlmjBiCr/le3wzhA37O8QTC5/Ab8+EXk= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.6/go.mod h1:hLMJt7Q8ePgViKupeymbqI0la+t9/iYFBjxQCFwuAwI= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= github.com/aws/aws-sdk-go-v2/service/kinesis v1.32.7 h1:QTtbqxI+i2gaWjcTwJZtm8/xEl9kiQXXbOatGabNuXA= github.com/aws/aws-sdk-go-v2/service/kinesis v1.32.7/go.mod h1:5aKZaOb2yfdeAOvfam0/6HoUXg01pN172bn7MqpM35c= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0 h1:nyuzXooUNJexRT0Oy0UQY6AhOzxPxhtt4DcBIHyCnmw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.71.0/go.mod h1:sT/iQz8JK3u/5gZkT+Hmr7GzVZehUMkRZpOaAwYXeGY= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= github.com/aws/aws-sdk-go-v2/service/sfn v1.34.1 h1:EsBALm4m1lGz5riWufNKWguTFOt7Nze7m0wVIzIq8wU= github.com/aws/aws-sdk-go-v2/service/sfn v1.34.1/go.mod h1:svXjjW4/t8lsSJa4+AUxYPevCzfw3m+z8sk4XcSsosU= github.com/aws/aws-sdk-go-v2/service/sns v1.33.7 h1:N3o8mXK6/MP24BtD9sb51omEO9J9cgPM3Ughc293dZc= @@ -174,8 +174,8 @@ github.com/elastic/go-elasticsearch/v6 v6.8.10 h1:2lN0gJ93gMBXvkhwih5xquldszpm8F github.com/elastic/go-elasticsearch/v6 v6.8.10/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= github.com/elastic/go-elasticsearch/v7 v7.17.10 h1:TCQ8i4PmIJuBunvBS6bwT2ybzVFxxUhhltAs3Gyu1yo= github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= -github.com/elastic/go-elasticsearch/v8 v8.16.0 h1:f7bR+iBz8GTAVhwyFO3hm4ixsz2eMaEy0QroYnXV3jE= -github.com/elastic/go-elasticsearch/v8 v8.16.0/go.mod h1:lGMlgKIbYoRvay3xWBeKahAiJOgmFDsjZC39nmO3H64= +github.com/elastic/go-elasticsearch/v8 v8.17.0 h1:e9cWksE/Fr7urDRmGPGp47Nsp4/mvNOrU8As1l2HQQ0= +github.com/elastic/go-elasticsearch/v8 v8.17.0/go.mod h1:lGMlgKIbYoRvay3xWBeKahAiJOgmFDsjZC39nmO3H64= github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -327,8 +327,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.1 h1:x7SYsPBYDkHDksogeSmZZ5xzThcTgRz++I5E+ePFUcs= -github.com/jackc/pgx/v5 v5.7.1/go.mod h1:e7O26IywZZ+naJtWWos6i6fvWK+29etgITqrqHLfoZA= +github.com/jackc/pgx/v5 v5.7.2 h1:mLoDLV6sonKlvjIEsV56SkWNCnuNv531l94GaIzO+XI= +github.com/jackc/pgx/v5 v5.7.2/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -375,8 +375,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.13.2 h1:9aAt4hstpH54qIcqkuUXRLTf+v7yOTfMPWzDtuqLmtA= -github.com/labstack/echo/v4 v4.13.2/go.mod h1:uc9gDtHB8UWt3FfbYx0HyxcCuvR4YuPYOxF/1QjoV/c= +github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY= +github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= @@ -632,8 +632,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -700,14 +700,14 @@ golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhS golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= -google.golang.org/grpc v1.69.0 h1:quSiOM1GJPmPH5XtU+BCoVXcDVJJAzNcoyfC2cCjGkI= -google.golang.org/grpc v1.69.0/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= +google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= +google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= -google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= +google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/DataDog/dd-trace-go.v1 v1.71.0-rc.1 h1:QHuirmvYilG6SaATi4MpdsHXJ3Pys/ckb1bJe+sRYro= gopkg.in/DataDog/dd-trace-go.v1 v1.71.0-rc.1/go.mod h1:FfnCB/MBJoyA8xzRAwYw1UlCaZXHz/YkkvBJ6UCFZoQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=