fix(ci): repair benchmark failures in protocol and relay suites#146
Merged
Conversation
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
marked this pull request as ready for review
July 19, 2026 15:53
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
cargo benchCI job that was failing on PR #145 (and would fail on any PR touching benchmarks).Root cause
chunk/write_read_roundtrippanicked onOk(0)fromchunk_read, but fragmented messages (4096-byte payload, 128-byte chunks) legitimately returnOk(0)until all continuation chunks are consumed.--test-threads 1, which is a libtest flag that criterion does not accept.Changes
Ok(0)returns; only panic when the buffer is exhausted without a complete message.--test-threads 1from.github/workflows/benchmarks.yml.Testing
cargo bench --bench protocol --features default -- --sample-size 10 --noplotcargo bench --bench relay --features default -- --sample-size 10 --noplotNeed help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
Benchmark and CI-only changes with no production runtime behavior.
Overview
Restores a green
cargo benchCI job by fixing the protocol round-trip benchmark loop and the relay benchmark workflow flags.The
chunk/write_read_roundtriploop no longer treats everyOk(0)fromchunk_readas failure; it only panics whenOk(0)happens with an empty buffer, so fragmented large payloads (128-byte chunks) can finish across multiple reads.The benchmarks workflow drops
--test-threads 1from the relaycargo benchinvocation 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.