diff --git a/lib/internal/quic/stats.js b/lib/internal/quic/stats.js index cd986827c12c47..e7e8e7ee2719a4 100644 --- a/lib/internal/quic/stats.js +++ b/lib/internal/quic/stats.js @@ -870,7 +870,7 @@ class QuicSessionStats { [kFinishClose]() { const view = TypedArrayPrototypeSubarray(this.#handle, this.#offset, - this.#offset + IDX_STATS_STREAM_COUNT); + this.#offset + IDX_STATS_SESSION_COUNT); this.#handle = new BigUint64Array(view); this.#offset = 0; this.#disconnected = true; diff --git a/test/parallel/test-quic-session-stream-lifecycle.mjs b/test/parallel/test-quic-session-stream-lifecycle.mjs index a4bd287cdc6dcd..f88351597ee845 100644 --- a/test/parallel/test-quic-session-stream-lifecycle.mjs +++ b/test/parallel/test-quic-session-stream-lifecycle.mjs @@ -90,6 +90,8 @@ clientSession.destroy(); strictEqual(clientSession.destroyed, true); strictEqual(clientSession.endpoint, null); strictEqual(clientSession.stats.isConnected, false); +strictEqual(typeof clientSession.stats.cwnd, 'bigint'); +strictEqual(typeof clientSession.stats.streamsIdleTimedOut, 'bigint'); strictEqual(stream.destroyed, true);