Skip to content

fix(ci): repair benchmark failures in protocol and relay suites#146

Merged
AlexanderWagnerDev merged 1 commit into
mainfrom
cursor/ci-autofix-automation-b788
Jul 19, 2026
Merged

fix(ci): repair benchmark failures in protocol and relay suites#146
AlexanderWagnerDev merged 1 commit into
mainfrom
cursor/ci-autofix-automation-b788

Conversation

@cursor

@cursor cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the cargo bench CI job that was failing on PR #145 (and would fail on any PR touching benchmarks).

Root cause

  1. protocol bench: chunk/write_read_roundtrip panicked on Ok(0) from chunk_read, but fragmented messages (4096-byte payload, 128-byte chunks) legitimately return Ok(0) until all continuation chunks are consumed.
  2. relay bench CI: The workflow passed --test-threads 1, which is a libtest flag that criterion does not accept.

Changes

  • Continue the read loop on intermediate Ok(0) returns; only panic when the buffer is exhausted without a complete message.
  • Remove --test-threads 1 from .github/workflows/benchmarks.yml.

Testing

  • cargo bench --bench protocol --features default -- --sample-size 10 --noplot
  • cargo bench --bench relay --features default -- --sample-size 10 --noplot
Open in Web View Automation 

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Benchmark and CI-only changes with no production runtime behavior.

Overview
Restores a green cargo bench CI job by fixing the protocol round-trip benchmark loop and the relay benchmark workflow flags.

The chunk/write_read_roundtrip loop no longer treats every Ok(0) from chunk_read as failure; it only panics when Ok(0) happens with an empty buffer, so fragmented large payloads (128-byte chunks) can finish across multiple reads.

The benchmarks workflow drops --test-threads 1 from the relay cargo bench invocation because that flag is for libtest, not Criterion.

Reviewed by Cursor Bugbot for commit 0e9504b. Bugbot is set up for automated code reviews on this repo. Configure here.

The protocol chunk roundtrip benchmark panicked on Ok(0) returns that are
normal for fragmented messages larger than the chunk size. Continue reading
until the message is complete or the buffer is exhausted.

Remove the unsupported --test-threads flag from the relay benchmark CI
step; criterion does not accept libtest threading options.

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
@AlexanderWagnerDev
AlexanderWagnerDev marked this pull request as ready for review July 19, 2026 15:53
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2e2abc6d-58b8-4354-a9e1-911296b6d0ad)

@AlexanderWagnerDev
AlexanderWagnerDev merged commit 32cdc58 into main Jul 19, 2026
32 checks passed
@AlexanderWagnerDev
AlexanderWagnerDev deleted the cursor/ci-autofix-automation-b788 branch July 20, 2026 10:47
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.

2 participants