Skip to content

test(reliability): add long-duration steady-state soak test - #79

Open
Harxhit wants to merge 1 commit into
mainfrom
test/long-duration-soak
Open

test(reliability): add long-duration steady-state soak test#79
Harxhit wants to merge 1 commit into
mainfrom
test/long-duration-soak

Conversation

@Harxhit

@Harxhit Harxhit commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Authored by Claude (Anthropic) via Claude Code. Not executed against a live backend — results are placeholders, not fabricated.


Summary by cubic

Adds a long-duration steady-state soak test for the signaling layer to catch slow leaks and gradual degradation that short, rapid connect/disconnect benchmarks miss.

  • Holds a fixed population of authenticated socket.io clients for hours, recycling a small random fraction each minute without changing population size.
  • Optional room join emits viewer:heartBeat events to keep Redis presence TTLs alive, exercising that machinery over the full window.
  • The pass signal is judged externally — server RSS, FD count, and thread counts staying flat — not from client-side stats; auto-reconnect is disabled so dropped sockets surface instead of being healed silently.
  • Not yet executed against a live backend; the results doc holds placeholders, not fabricated numbers.

Written for commit 553d761. Summary will update on new commits.

Review in cubic

socket.io-client test that holds a steady-state connected population for hours
with light periodic churn, to surface slow leaks/degradation over time — distinct
from the short, rapid connect/disconnect soak.

- load-test/long-duration-soak.js — steady population + churn + interval health/metrics sampling
- load-test/results/LONG-DURATION-SOAK.md — leak-over-time methodology (RSS/FD over hours)

Authored by Claude (Anthropic) via Claude Code. Not executed against a live
backend — results are placeholders, not fabricated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4270ce0f-26f0-4b83-9584-2d4172bb35f8


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.0% Duplication on New Code (required ≤ 3%)
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="load-test/results/LONG-DURATION-SOAK.md">

<violation number="1" location="load-test/results/LONG-DURATION-SOAK.md:12">
P3: The doc cites `load-test/sfu-capacity.js` as an existing test, but no such file exists anywhere in the repo — load-test/ only contains `long-duration-soak.js` and `signaling-latency.js`. Update the reference to the actual short/rapid capacity test file name so readers aren't sent looking for a file that doesn't exist.</violation>
</file>

<file name="load-test/long-duration-soak.js">

<violation number="1" location="load-test/long-duration-soak.js:36">
P2: When a numeric flag is malformed or missing, `parseInt` yields `NaN`; the script then runs with zero clients or zero duration and reports a summary. Validate finite, positive argument values before starting the soak.</violation>

<violation number="2" location="load-test/long-duration-soak.js:108">
P2: When `METRICS_URL` sends headers but stalls while streaming the body, this timeout is cleared before `res.text()` runs, so the soak can wait forever. Keep the abort timer active through body consumption and clear it in `finally`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

const TOKEN = arg("token", null);
const DO_JOIN = arg("join", "false") === "true";

const NUM_CLIENTS = parseInt(arg("clients", "200"), 10);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When a numeric flag is malformed or missing, parseInt yields NaN; the script then runs with zero clients or zero duration and reports a summary. Validate finite, positive argument values before starting the soak.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At load-test/long-duration-soak.js, line 36:

<comment>When a numeric flag is malformed or missing, `parseInt` yields `NaN`; the script then runs with zero clients or zero duration and reports a summary. Validate finite, positive argument values before starting the soak.</comment>

<file context>
@@ -0,0 +1,542 @@
+const TOKEN = arg("token", null);
+const DO_JOIN = arg("join", "false") === "true";
+
+const NUM_CLIENTS = parseInt(arg("clients", "200"), 10);
+const DURATION_MIN = parseInt(arg("durationMin", "120"), 10);
+const CHURN_INTERVAL_MS = parseInt(arg("churnIntervalMs", "60000"), 10);
</file context>

const t0 = performance.now();

socket.emit(event, ...args, (response) => {
clearTimeout(timer);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When METRICS_URL sends headers but stalls while streaming the body, this timeout is cleared before res.text() runs, so the soak can wait forever. Keep the abort timer active through body consumption and clear it in finally.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At load-test/long-duration-soak.js, line 108:

<comment>When `METRICS_URL` sends headers but stalls while streaming the body, this timeout is cleared before `res.text()` runs, so the soak can wait forever. Keep the abort timer active through body consumption and clear it in `finally`.</comment>

<file context>
@@ -0,0 +1,542 @@
+    const t0 = performance.now();
+
+    socket.emit(event, ...args, (response) => {
+      clearTimeout(timer);
+
+      resolve({
</file context>


## Roadmap gap this fills

The existing `load-test/sfu-capacity.js` (and the signaling latency probe) are

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The doc cites load-test/sfu-capacity.js as an existing test, but no such file exists anywhere in the repo — load-test/ only contains long-duration-soak.js and signaling-latency.js. Update the reference to the actual short/rapid capacity test file name so readers aren't sent looking for a file that doesn't exist.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At load-test/results/LONG-DURATION-SOAK.md, line 12:

<comment>The doc cites `load-test/sfu-capacity.js` as an existing test, but no such file exists anywhere in the repo — load-test/ only contains `long-duration-soak.js` and `signaling-latency.js`. Update the reference to the actual short/rapid capacity test file name so readers aren't sent looking for a file that doesn't exist.</comment>

<file context>
@@ -0,0 +1,177 @@
+
+## Roadmap gap this fills
+
+The existing `load-test/sfu-capacity.js` (and the signaling latency probe) are
+**short and rapid**: they ramp viewers up, measure connect/join/first-frame
+latency, and tear down. That surfaces capacity ceilings and connect-storm
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant