0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-11 14:47:26 -04:00
deno/tests/specs/cli/otel_basic/http_metric.ts
Nathan Whitaker 3fdde62ba2
chore: fix otel test flakiness (#28209)
The bucket counts can vary run to run. Also don't hardcode the port
2025-02-20 21:06:42 +00:00

16 lines
250 B
TypeScript

let port;
const server = Deno.serve(
{
port: 0,
onListen: (addr) => {
port = addr.port;
},
},
() => new Response("foo"),
);
for (let i = 0; i < 3; i++) {
await fetch(`http://localhost:${port}`);
}
await server.shutdown();