Skip to content

test(reliability): add reconnection-storm (thundering herd) test - #85

Open
Harxhit wants to merge 1 commit into
mainfrom
test/reconnection-storm
Open

test(reliability): add reconnection-storm (thundering herd) test#85
Harxhit wants to merge 1 commit into
mainfrom
test/reconnection-storm

Conversation

@Harxhit

@Harxhit Harxhit commented Aug 27, 2026

Copy link
Copy Markdown
Owner

socket.io-client test that connects many auto-reconnecting clients, then triggers a simultaneous mass drop (forcedrop) or a manual pod kill (killpod) and measures recovery-time distribution + success rate — quantifies recovery, which the cold spike test never did.

  • load-test/reconnection-storm.js — forcedrop|killpod modes; reconnect+rejoin timing
  • load-test/results/RECONNECTION-STORM.md — modes, interpretation, backoff/jitter notes

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


Summary by cubic

Adds a reconnection-storm load test that measures herd recovery after a simultaneous client drop, which the existing cold-connect spike test never covered.

  • Connects socket.io-client clients with auto-reconnection enabled, drops them all at once (forcedrop) or when a signaling pod is killed (killpod), and reports reconnect+re-join percentiles and recovery success within a configurable window.
  • Not yet executed against a live backend; the results file contains placeholders rather than fabricated numbers.

Written for commit d3b16c9. Summary will update on new commits.

Review in cubic

socket.io-client test that connects many auto-reconnecting clients, then triggers
a simultaneous mass drop (forcedrop) or a manual pod kill (killpod) and measures
recovery-time distribution + success rate — quantifies recovery, which the cold
spike test never did.

- load-test/reconnection-storm.js — forcedrop|killpod modes; reconnect+rejoin timing
- load-test/results/RECONNECTION-STORM.md — modes, interpretation, backoff/jitter notes

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: 0b7ec7cc-156b-49c8-8344-58951d1fe43b


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
7.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@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/reconnection-storm.js">

<violation number="1" location="load-test/reconnection-storm.js:217">
P2: In `killpod` mode, unrelated disconnects after the prompt are scored as victims, so recovery percentiles and success rate do not represent the killed pod. Track the affected pod/client set or otherwise distinguish the kill-induced disconnects before tallying.</violation>

<violation number="2" location="load-test/reconnection-storm.js:237">
P2: In `forcedrop` mode, connected clients whose baseline `joinRoom` failed or is still pending are counted as recovered/stalled storm members. Require `baselineJoined` when selecting clients to drop.</violation>

<violation number="3" location="load-test/reconnection-storm.js:307">
P2: In `killpod` mode, operator delay is included in every recovery time and can consume the recovery window before the pod is killed. Wait for an explicit post-kill confirmation or set `triggerAt` when the actual kill is initiated.</violation>
</file>

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

Re-trigger cubic


// ---- trigger the storm ----
stormTriggered = true;
triggerAt = performance.now();

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: In killpod mode, operator delay is included in every recovery time and can consume the recovery window before the pod is killed. Wait for an explicit post-kill confirmation or set triggerAt when the actual kill is initiated.

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

<comment>In `killpod` mode, operator delay is included in every recovery time and can consume the recovery window before the pod is killed. Wait for an explicit post-kill confirmation or set `triggerAt` when the actual kill is initiated.</comment>

<file context>
@@ -0,0 +1,395 @@
+
+  // ---- trigger the storm ----
+  stormTriggered = true;
+  triggerAt = performance.now();
+
+  if (MODE === "forcedrop") {
</file context>

});

socket.on("disconnect", () => {
if (stormTriggered) client.droppedAfterTrigger = true;

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: In killpod mode, unrelated disconnects after the prompt are scored as victims, so recovery percentiles and success rate do not represent the killed pod. Track the affected pod/client set or otherwise distinguish the kill-induced disconnects before tallying.

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

<comment>In `killpod` mode, unrelated disconnects after the prompt are scored as victims, so recovery percentiles and success rate do not represent the killed pod. Track the affected pod/client set or otherwise distinguish the kill-induced disconnects before tallying.</comment>

<file context>
@@ -0,0 +1,395 @@
+  });
+
+  socket.on("disconnect", () => {
+    if (stormTriggered) client.droppedAfterTrigger = true;
+  });
+
</file context>

for (const client of clients) {
// Only drop clients that were actually in steady state; a client that never
// connected was not part of the herd and should not count against recovery.
if (!client.socket.connected) continue;

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: In forcedrop mode, connected clients whose baseline joinRoom failed or is still pending are counted as recovered/stalled storm members. Require baselineJoined when selecting clients to drop.

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

<comment>In `forcedrop` mode, connected clients whose baseline `joinRoom` failed or is still pending are counted as recovered/stalled storm members. Require `baselineJoined` when selecting clients to drop.</comment>

<file context>
@@ -0,0 +1,395 @@
+  for (const client of clients) {
+    // Only drop clients that were actually in steady state; a client that never
+    // connected was not part of the herd and should not count against recovery.
+    if (!client.socket.connected) continue;
+
+    client.droppedAfterTrigger = true;
</file context>
Suggested change
if (!client.socket.connected) continue;
if (!client.socket.connected || !client.baselineJoined) continue;

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