Skip to content

chore(test): Fixing flaky ssrf#7617

Merged
uurien merged 13 commits intomasterfrom
ugaitzflaky-ssrf
Feb 27, 2026
Merged

chore(test): Fixing flaky ssrf#7617
uurien merged 13 commits intomasterfrom
ugaitzflaky-ssrf

Conversation

@uurien
Copy link
Copy Markdown
Collaborator

@uurien uurien commented Feb 25, 2026

What does this PR do?

Tries to fix the flaky test happening in the rasp test file ssrf.express.plugin.spec.js.
There is no easy way to reproduce the failure, but I figured out that the reason why the web root span is not found is because the trace is not complete and it is not sent to the agent.
This could happen when timeout happens before the outgoing http request finishes. That is why I made some changes in the tested controller to be sure that the outgoing request span is closed as soon as possible, calling to res.resume() and finishing the main request when the outgoing request has finished.

Motivation

Reduce flaky tests

Additional Notes

50 success executions in the CI: https://github.com/DataDog/dd-trace-js/actions/runs/22406751414/job/64868757093?pr=7617

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 25, 2026

Overall package size

Self size: 4.84 MB
Deduped: 5.69 MB
No deduping: 5.69 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 25, 2026

Benchmarks

Benchmark execution time: 2026-02-27 08:55:40

Comparing candidate commit dadac52 in PR branch ugaitzflaky-ssrf with baseline commit af50fef in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 233 metrics, 27 unstable metrics.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.24%. Comparing base (af50fef) to head (dadac52).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7617      +/-   ##
==========================================
- Coverage   80.32%   80.24%   -0.08%     
==========================================
  Files         734      733       -1     
  Lines       31602    31662      +60     
==========================================
+ Hits        25383    25408      +25     
- Misses       6219     6254      +35     
Flag Coverage Δ
aiguard-macos 38.94% <ø> (+0.03%) ⬆️
aiguard-ubuntu 39.05% <ø> (+0.02%) ⬆️
aiguard-windows 38.79% <ø> (+0.03%) ⬆️
apm-capabilities-tracing-macos 48.51% <ø> (-0.03%) ⬇️
apm-capabilities-tracing-ubuntu 48.54% <ø> (-0.03%) ⬇️
apm-capabilities-tracing-windows 48.29% <ø> (+0.02%) ⬆️
apm-integrations-child-process 38.52% <ø> (+0.03%) ⬆️
apm-integrations-couchbase-18 37.44% <ø> (+0.04%) ⬆️
apm-integrations-couchbase-eol 37.92% <ø> (+0.18%) ⬆️
apm-integrations-oracledb 37.75% <ø> (+0.04%) ⬆️
appsec-express 55.38% <ø> (-0.11%) ⬇️
appsec-fastify 51.69% <ø> (-0.10%) ⬇️
appsec-graphql 51.87% <ø> (-0.11%) ⬇️
appsec-kafka 44.35% <ø> (-0.13%) ⬇️
appsec-ldapjs 44.04% <ø> (-0.01%) ⬇️
appsec-lodash 43.70% <ø> (-0.05%) ⬇️
appsec-macos 58.38% <ø> (-0.16%) ⬇️
appsec-mongodb-core 48.86% <ø> (-0.04%) ⬇️
appsec-mongoose 49.54% <ø> (-0.05%) ⬇️
appsec-mysql 50.90% <ø> (-0.06%) ⬇️
appsec-node-serialize 43.21% <ø> (-0.05%) ⬇️
appsec-passport 47.67% <ø> (-0.06%) ⬇️
appsec-postgres 50.64% <ø> (-0.08%) ⬇️
appsec-sourcing 42.61% <ø> (+<0.01%) ⬆️
appsec-template 43.38% <ø> (-0.05%) ⬇️
appsec-ubuntu 58.46% <ø> (-0.16%) ⬇️
appsec-windows 58.24% <ø> (-0.16%) ⬇️
instrumentations-instrumentation-bluebird 32.31% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-body-parser 40.49% <ø> (+0.01%) ⬆️
instrumentations-instrumentation-child_process 37.84% <ø> (+0.04%) ⬆️
instrumentations-instrumentation-cookie-parser 34.31% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-express 34.64% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-express-mongo-sanitize 34.44% <ø> (+0.07%) ⬆️
instrumentations-instrumentation-express-session 40.12% <ø> (+0.01%) ⬆️
instrumentations-instrumentation-fs 31.92% <ø> (+0.11%) ⬆️
instrumentations-instrumentation-generic-pool 29.73% <ø> (+0.19%) ⬆️
instrumentations-instrumentation-http 39.84% <ø> (+0.01%) ⬆️
instrumentations-instrumentation-knex 32.31% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-mongoose 33.45% <ø> (+0.08%) ⬆️
instrumentations-instrumentation-multer 40.24% <ø> (+0.01%) ⬆️
instrumentations-instrumentation-mysql2 38.31% <ø> (+0.03%) ⬆️
instrumentations-instrumentation-passport 44.03% <ø> (-0.03%) ⬇️
instrumentations-instrumentation-passport-http 43.70% <ø> (-0.03%) ⬇️
instrumentations-instrumentation-passport-local 44.24% <ø> (-0.03%) ⬇️
instrumentations-instrumentation-pg 37.73% <ø> (+0.04%) ⬆️
instrumentations-instrumentation-promise 32.24% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-promise-js 32.25% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-q 32.29% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-url 32.21% <ø> (+0.10%) ⬆️
instrumentations-instrumentation-when 32.26% <ø> (+0.10%) ⬆️
llmobs-ai 41.30% <ø> (+<0.01%) ⬆️
llmobs-anthropic 40.31% <ø> (+0.01%) ⬆️
llmobs-bedrock 39.26% <ø> (+0.02%) ⬆️
llmobs-google-genai 39.84% <ø> (+0.01%) ⬆️
llmobs-langchain 39.75% <ø> (+0.25%) ⬆️
llmobs-openai 44.08% <ø> (-0.02%) ⬇️
llmobs-vertex-ai 40.03% <ø> (+0.01%) ⬆️
platform-core 31.53% <ø> (+1.82%) ⬆️
platform-esbuild 34.48% <ø> (+1.58%) ⬆️
platform-instrumentations-misc 43.70% <ø> (+0.81%) ⬆️
platform-shimmer 37.63% <ø> (+1.48%) ⬆️
platform-unit-guardrails 32.95% <ø> (+1.68%) ⬆️
plugins-azure-event-hubs 25.59% <ø> (+1.57%) ⬆️
plugins-azure-service-bus 24.96% <ø> (+1.53%) ⬆️
plugins-bullmq 43.74% <ø> (-0.01%) ⬇️
plugins-cassandra 37.79% <ø> (+0.04%) ⬆️
plugins-cookie 26.65% <ø> (+1.57%) ⬆️
plugins-cookie-parser 26.44% <ø> (+1.56%) ⬆️
plugins-crypto 26.79% <ø> (+2.06%) ⬆️
plugins-dd-trace-api 38.37% <ø> (+0.03%) ⬆️
plugins-express-mongo-sanitize 26.59% <ø> (+1.55%) ⬆️
plugins-express-session 26.40% <ø> (+1.56%) ⬆️
plugins-fastify 42.24% <ø> (+<0.01%) ⬆️
plugins-fetch 38.33% <ø> (+0.03%) ⬆️
plugins-fs 38.62% <ø> (+0.03%) ⬆️
plugins-generic-pool 25.63% <ø> (+1.57%) ⬆️
plugins-google-cloud-pubsub 45.38% <ø> (-0.04%) ⬇️
plugins-grpc 40.94% <ø> (+<0.01%) ⬆️
plugins-handlebars 26.63% <ø> (+1.55%) ⬆️
plugins-hapi 40.13% <ø> (+0.01%) ⬆️
plugins-hono 40.39% <ø> (+0.01%) ⬆️
plugins-ioredis 38.43% <ø> (+0.03%) ⬆️
plugins-knex 26.28% <ø> (+1.47%) ⬆️
plugins-ldapjs 24.13% <ø> (+1.51%) ⬆️
plugins-light-my-request 26.00% <ø> (+1.51%) ⬆️
plugins-limitd-client 32.60% <ø> (+0.10%) ⬆️
plugins-lodash 25.72% <ø> (+1.58%) ⬆️
plugins-mariadb 39.49% <ø> (+0.02%) ⬆️
plugins-memcached 38.17% <ø> (+0.04%) ⬆️
plugins-microgateway-core 39.17% <ø> (-0.06%) ⬇️
plugins-moleculer 40.51% <ø> (+0.01%) ⬆️
plugins-mongodb 39.20% <ø> (+0.02%) ⬆️
plugins-mongodb-core 39.03% <ø> (+0.02%) ⬆️
plugins-mongoose 38.86% <ø> (+0.02%) ⬆️
plugins-multer 26.40% <ø> (+1.56%) ⬆️
plugins-mysql 39.17% <ø> (+0.02%) ⬆️
plugins-mysql2 39.27% <ø> (+0.02%) ⬆️
plugins-node-serialize 26.69% <ø> (+1.57%) ⬆️
plugins-opensearch 37.62% <ø> (+0.04%) ⬆️
plugins-passport-http 26.45% <ø> (+1.53%) ⬆️
plugins-postgres 35.73% <ø> (+0.04%) ⬆️
plugins-process 26.79% <ø> (+2.06%) ⬆️
plugins-pug 26.65% <ø> (+1.57%) ⬆️
plugins-redis 38.90% <ø> (+0.03%) ⬆️
plugins-router 42.97% <ø> (-0.02%) ⬇️
plugins-sequelize 25.23% <ø> (+1.57%) ⬆️
plugins-test-and-upstream-amqp10 38.50% <ø> (+0.18%) ⬆️
plugins-test-and-upstream-amqplib 43.83% <ø> (-0.03%) ⬇️
plugins-test-and-upstream-apollo 39.03% <ø> (+0.02%) ⬆️
plugins-test-and-upstream-avsc 38.71% <ø> (+0.03%) ⬆️
plugins-test-and-upstream-bunyan 33.88% <ø> (+0.08%) ⬆️
plugins-test-and-upstream-connect 40.79% <ø> (+<0.01%) ⬆️
plugins-test-and-upstream-graphql 40.14% <ø> (+0.01%) ⬆️
plugins-test-and-upstream-koa 40.30% <ø> (-0.07%) ⬇️
plugins-test-and-upstream-protobufjs 38.94% <ø> (+0.02%) ⬆️
plugins-test-and-upstream-rhea 44.06% <ø> (+<0.01%) ⬆️
plugins-undici 39.11% <ø> (+0.02%) ⬆️
plugins-url 26.79% <ø> (+2.06%) ⬆️
plugins-valkey 38.09% <ø> (+0.03%) ⬆️
plugins-vm 26.79% <ø> (+2.06%) ⬆️
plugins-winston 34.07% <ø> (+0.08%) ⬆️
plugins-ws 41.89% <ø> (+<0.01%) ⬆️
profiling-macos 39.84% <ø> (+0.01%) ⬆️
profiling-ubuntu 39.96% <ø> (+0.01%) ⬆️
profiling-windows 41.17% <ø> (+<0.01%) ⬆️
serverless-azure-functions-client 25.31% <ø> (+1.55%) ⬆️
serverless-azure-functions-eventhubs 25.31% <ø> (+1.55%) ⬆️
serverless-azure-functions-servicebus 25.31% <ø> (+1.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-datadog-prod-us1-2

This comment has been minimized.

@uurien uurien marked this pull request as ready for review February 25, 2026 17:35
@uurien uurien requested a review from a team as a code owner February 25, 2026 17:35
@uurien uurien enabled auto-merge (squash) February 26, 2026 10:24
@uurien uurien merged commit 05f01a0 into master Feb 27, 2026
792 checks passed
@uurien uurien deleted the ugaitzflaky-ssrf branch February 27, 2026 13:38
@dd-octo-sts dd-octo-sts bot mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants