Repository navigation
Conversation
Shared helpers for porting the Rust livekit-data-stream crate's tests to end-to-end C++ tests: - FfiPeer drives a room's participant through the raw FFI, so it sends exactly what another FFI-based SDK sends: one-shot sends and stream writers go through the Rust outgoing manager (data streams v2), and raw header/chunk/trailer requests send hand-built v1 packets. - RawPacketSniffer records the raw stream packets a room receives. - Text/ByteStreamCollector receive through the public C++ API and record content, info and errors. The harness only uses API that predates the FFI reader/writer port, so tests built on it compile before and after that port. Also mint an optional LIVEKIT_TOKEN_C (cpp-test-c) for tests that need a third participant, and add RoomTestAccess::roomHandleId. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports the incoming-manager tests of the Rust livekit-data-stream crate that the current C++ receive path already handles: v1 text and byte round trips, trailer attribute merging, empty chunks, and a remote text writer's trailer attributes. The other v1 tests (duplicate chunks, length and gap errors, close reasons, orphan packets, disconnects) fail on main and land with the receive-path fix that makes them pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 30, 2026
Memory tester resultsIterations: 100
|
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.
Part 1 of 5 of the data streams v2 stack. Merge in order; each part is mergeable on its own.
sendText/sendBytes/sendFileByteStreamReader::writeToFileand a receive size limitstreamText/streamBytesThis stack replaces #321, #322 and #325 (same code, reordered so each step stands on its own).
Adds the helpers for end-to-end data stream tests ported from the Rust
livekit-data-streamcrate, plus the 5 receive tests that already pass onmain. There's no SDK change. The rest of the stack adds the remaining ported tests next to the code that makes them pass.Helpers (
src/tests/common/data_stream_test_utils.h)FfiPeerdrives the other participant through the raw FFI, so it sends exactly what Python, Unity and the other FFI-based SDKs send:RawPacketSnifferrecords the raw stream packets a room receives. The raw header event carries neitherinline_contentnorcompression, so:TextStreamCollector/ByteStreamCollectorreceive through the public C++ API and record content, info and errors.main, so the receive tests in part 2 build against both the old and new receive paths.Also:
scripts/set-test-tokens.shnow mints an optionalLIVEKIT_TOKEN_C(cpp-test-c) for tests that need a third participant. Tests that need it skip without it. CI already sources the script.RoomTestAccess::roomHandleIdis added.Tests
test_data_stream_conformance_receive_v1.cppstarts with the 5 v1 receive tests that pass onmain:The other 12 v1 tests fail on
mainand land in part 2 with the fix.Verification (local, macOS arm64,
livekit-server --dev)mainplus tests.DataTrackE2ETestschema tests (DefineAndGetSchema,DefineAndGetCustomSchemaEncoding,DefineDuplicateSchemaFails). They fail onmainon this machine too, and the 1 skip is the token-server test.🤖 Generated with Claude Code