You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* test(profiler): fix Profiler telemetry flake
The integration test `profiler > Profiler telemetry > sends profiler API
telemetry` accounts for the bulk of recent Profiling flakes. Two issues:
1. `assertTelemetryReceived` in fake-agent.js filters only by
`request_type`, but the tracer's NamespaceManager emits a
`generate-metrics` payload per namespace (`tracers`, `profilers`,
`appsec`, ...). Tracer-namespace messages tripped the inner
`assert.strictEqual(pp.namespace, 'profilers')` check, polluting
the collected `errors[]` with confusing `'tracers' !== 'profilers'`
noise on any failure.
2. The `requestCount <= 3` upper bound was off-by-one: with
DD_PROFILING_UPLOAD_PERIOD=1 and TEST_DURATION_MS=2500, the
periodic-vs-shutdown race the comment already calls out can yield
4 uploads.
Add an optional `namespace` parameter to `assertTelemetryReceived` that
filters at the same point as `requestType` (backward-compatible, no
existing callers pass a 6th argument). Use it from the three profiler
telemetry assertions and bump the bound to `<= 4`.
* refactor(test): convert assertTelemetryReceived to a single options arg
The signature had grown to six positional parameters with a built-in
overload that shifted them when `fn` was omitted, which was hard to
read and easy to get wrong. Convert to a single options object with
defaulted properties (`fn`, `requestType`, `timeout`,
`expectedMessageCount`, `resolveAtFirstSuccess`, `namespace`) and
update all 16 call sites.
No behavior change; only the call shape.
* fix(test): preserve never-resolve semantics for SSI-absent telemetry check
The `records profile on process exit` test wraps a telemetry assertion
in `expectTimeout`, which requires the inner promise to reject with a
timeout. The original 2-arg call relied on a quirk in the helper's
positional overload that left `expectedMessageCount` at 30000, making
the promise effectively unresolvable.
The options-object refactor restored the documented default of 1, so
the first matching `generate-metrics` message resolved the promise and
broke the test. Make the intent explicit with `expectedMessageCount:
Infinity` and a comment explaining why.
0 commit comments