Repository navigation
Fix failing doctests and env suites - #208
Conversation
Seven doc examples across three crates did not compile, so nothing had ever checked them and they had drifted from what they document. A workspace test run stops at the first crate that fails, which is why only two of them were ever visible. The signature examples named values that were never bound and a type that was never imported. One of them then asserted that a signature header starts with the key id, when it starts with the key id under a name, so it failed once it could run at all. The helpers examples called a method without the trait that provides it in scope, and referred to the function and type they document without importing either. The jsonpath one also asserted that injecting a value returned false while asserting the value had been injected, which contradicts itself and the sentence above it. The workflow examples named a crate that does not exist, called asynchronous methods without awaiting them and used a service nothing had bound. Its payload had drifted furthest, missing a field and giving three others types they have never had, since nothing was compiling it as the struct changed underneath. Every example is now a compiled one, with the setup a reader does not need hidden and the assertions saying what the code actually does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ects The test collected messages until it had counted three hundred iterations, with nothing bounding how long that took. A queue nothing had created, an endpoint nothing was listening on, or a consumer that had stopped all presented the same way, as a run that never returned and never said why. Counting iterations rather than messages made the other outcome no better. A closed channel spun through the remaining count and asserted on an empty collection, saying only that zero is not three hundred. It now counts what it collected, stops on a deadline or on the channel closing, and reports how many of the three hundred arrived along with the two things worth checking first. The deadline is generous, since the sender spaces its messages out and a loaded machine is not a failure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every event result set a context to none and nothing ever read one, so the field was a line on each of the eight places that built a result and an optional value in the shape every SDK binding compiles against. Removed rather than filled in, since what it was for is not recorded anywhere and the two call modes both answer callers without it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…corded The offset moved before the result was examined and before any failure reached the dead letter queue. A process that stopped in between left the batch behind the offset with nothing anywhere recording it, and since this consumer reads by offset rather than through a consumer group, behind the offset is gone. It now moves last. Straight away where every message was processed, after the failures are written where a failure was reported, and not at all where that write did not succeed, so the batch is read again rather than passed over. Reading it again redelivers what did succeed, which is the cost of one watermark covering a whole batch and cheaper than losing the rest. There is no test for this. What it guards against is a process stopping between two calls to Redis, which the suite has no way to stage without injecting a fault into the connection, so the existing tests show the paths either side are intact and nothing more. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Naming a package built a command cargo refuses, since the exclude it carries alongside is only allowed with a workspace selection. Getting past that, the features are the workspace's own and a single package does not have them, so the flag has never run anything. A named package now narrows which tests run rather than which packages are built, which resolves exactly the features a full run does and leaves the two passes comparable. The cluster pass is skipped where the named package has no Redis-backed tests, rather than running the same seven suites whatever was asked for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The runtime took a batch and sent it in one line, awaiting each message before starting the next. For a message asking its client to acknowledge it, that answer is a round trip to the client rather than a write to a socket, so every message behind it waited out the one before, and a client that never answered held up all of them until the runtime gave up on its message. That made a batch worth no more than the sends it replaced, which is most of the reason for carrying several messages in one frame. Messages are now grouped by the connection they are for and the groups are sent alongside each other, so one client being slow to answer costs only the messages meant for it. Within a connection they are still sent in the order the handler listed them, which is the one ordering a handler can reasonably expect and costs nothing to keep. Failures are put back into the order the handler gave before they are reported. The connections are served in no order at all, and the position a message had in the batch is the only thing the handler has to match a failure against, since the runtime generates the id where one was not supplied. The registry the tests stand up can hold a connection open, so one test shows a later message reaching a different client while the first is still waiting and another shows two messages for one client keeping their order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThe changes update Redis failure acknowledgement, WebSocket batch delivery, the ChangesMessage delivery behavior
EventResult contract cleanup
Test execution updates
Documentation examples
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Batch as WebSocket batch delivery
participant Registry as WebSocket registry
participant ConnectionA as Connection A
participant ConnectionB as Connection B
Batch->>Registry: Group messages by connection
Batch->>ConnectionA: Send messages in order
Batch->>ConnectionB: Send messages concurrently
ConnectionA-->>Batch: Return send result
ConnectionB-->>Batch: Return send result
Batch-->>Registry: Restore failures by batch index
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|



Summary by CodeRabbit
Improvements
Breaking Changes
contextfield from event results.Documentation