Skip to content

test(ssh): freeze FrameDecoder clock in framing unit tests - #12356

Merged
AmethystLiang merged 1 commit into
mainfrom
fix/frame-decoder-framing-test-flake
Aug 3, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix/frame-decoder-framing-test-flake

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

  • FrameDecoder bounds each drain turn to 4ms and defers remaining frames via setImmediate.
  • Under CI load, multi-frame framing tests could assert after only the first frame and flake.
  • Freeze the decoder clock in framing correctness tests so turn budgeting cannot defer frames; time-sliced drain remains covered by relay-protocol-backpressure.test.ts.

Test plan

  • pnpm exec vitest run src/main/ssh/relay-protocol.test.ts src/main/ssh/relay-protocol-backpressure.test.ts
  • Confirm CI tests job is green

Default 4ms maxTurnMs can defer later frames via setImmediate under
CI load, so multi-frame assertions after a single feed were flaky.
@AmethystLiang
AmethystLiang merged commit 031115b into main Aug 3, 2026
41 checks passed
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 127e3b9c-bc94-43b2-bafd-df5812ac17af

📥 Commits

Reviewing files that changed from the base of the PR and between 7de40ff and 8e090b8.

📒 Files selected for processing (1)
  • src/main/ssh/relay-protocol.test.ts

📝 Walkthrough

Walkthrough

The tests add a frozen clock fixture with now() returning 0. They pass this clock to FrameDecoder across complete, partial, multi-frame, keepalive, oversized-frame, reset, byte-by-byte, resynchronization, and large-frame buffering cases. This prevents wall-clock turn budgeting from deferring frame processing during test execution.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…12356)

Default 4ms maxTurnMs can defer later frames via setImmediate under
CI load, so multi-frame assertions after a single feed were flaky.
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