Repository navigation
test(bindings): cover MoqBroadcastConsumer.closed in Kotlin, Swift, and Dart - #7540
Conversation
Quest-Claim: b5c87e210376c378
…nd Dart Go, Python, and the Rust FFI already test that a broadcast consumer's closed() returns once the broadcast ends; the remaining wrappers expose it through aliases but had no test. The moq-transport run-end error kind is owned by quest/m1/ffi-ietf-run-end.md, so this quest is complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 4e74e9a61a2e21623cf72087534436e68e04082e.
No actionable bugs found. The small binding-level smoke tests exercise the existing close signal without adding API or wire complexity. Removing the duplicate quest is reasonable: the remaining moq-transport error mapping is still tracked by quest/m1/ffi-ietf-run-end.md.
Verification: static review of the changes and relevant wrappers/FFI behavior only; no tests run. Kotlin and Swift cover completion after close, not deterministic pending-wait wakeup coverage; the existing Rust test covers that distinction.
(Written by OpenAI)
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dart
closed()test (dart/moq/test/moq_test.dart:390) — assertsclosed()rests pending while the broadcast is live, then resolves afterbroadcast.close(). The inline consumer handle is safe to discard: the generatedclosed()callsuniffiClonePointer()and retains the RustArcfor the async call's lifetime. - Kotlin
closed()test (kt/.../SmokeTest.kt:254) — usesbroadcast.end(), which is the Kotlin name for the Rustclose, not the AutoCloseableclose()(that only releases the producer handle and, with a consumer held open, would not end the broadcast). Correct choice. - Swift
closed()test (swift/.../SmokeTests.swift:329) — awaitsbroadcast.close()and theTask, ARC releases the handles. - Quest cleanup —
quest/m2/binding-broadcast-end.mddeleted and itsquest/m2/README.mdbullet removed; the remaining goal lives inquest/m1/ffi-ietf-run-end.md. No dangling references remain.
The tests exercise MoqBroadcastConsumer.closed() (unchanged FFI, rs/moq-ffi/src/consumer.rs:318) and fail loudly if it never resolves. The Dart 10 ms wall-clock delay is deterministic here (the broadcast is live, so resolved cannot flip early) and Dart exposes no injectable clock, so it is not a flake risk.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
codex / Codex land fixer note:
(written by codex / Codex) |
|
codex / Codex land fixer: Conflicts with the base: dart/moq/test/moq_test.dart (written by codex / Codex) |
|
OpenRouter returned an error, so this run stopped. If it names your key, plan or balance, fix that with the provider or pick another model.
|

Summary
Finishes quest/m2/binding-broadcast-end.md and deletes it.
The quest had two parts. Both are now done or owned by another quest:
MoqBroadcastConsumer.closed()shipped in moq-dev/moq#7304, along with tests in Rust (rs/moq-ffi/src/test.rs), Go (TestBroadcastConsumerClosed), and Python (test_broadcast_consumer_closed_resolves_on_close). Kotlin, Swift, and Dart already expose it through their aliases but had no test. The Plan said "Cover it in each binding's tests", so this PR adds one test to each:kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt:a broadcast consumer's closed returns once the broadcast endsswift/Tests/MoqTests/SmokeTests.swift:testBroadcastConsumerClosedReturnsOnClosedart/moq/test/moq_test.dart:a broadcast consumer's closed() resolves once it closes. This one also checks thatclosed()is still pending while the broadcast is live, as the Python and Rust tests do.Internalis the whole Goal of quest/m1/ffi-ietf-run-end.md. That quest came out of the same planning of moq-dev/moq.pro#3169 a day later, on 2026-10-31, and its Plan already notes thatclosed()shipped. It is being worked in draft moq-dev/moq#7479, which waits on a maintainer decision about the wire mapping. This quest did not need a second copy of that work.The downstream bullet, moq.pro's Go and Kotlin samples switching to
closed(), lives in moq.pro and comes with its pin bump.Choices made without asking
Required: /quest/m1/ffi-ietf-run-end.md.closed()returns after the broadcast ends, like the Go test. Neither checks that it stays pending while the broadcast is live, because there is no reliable way to do that underrunTestor with an XCTestTask. The Rust FFI test covers that behavior.Validation
Head
ee0502a495mergesorigin/main(d8288e6934) into the PR. That merge resolves a conflict indart/moq/test/moq_test.dart: base replaced the old microsecond timestamp test withtimestamps round-trip exactly at the track scaleandtimestamps convert to and from Durations. The closed test now sits before those two tests, so againstmainthe Dart diff adds only that test.All runs used
quest gate nix develop -c ...on the merged head:just dart check: passed. All 36 tests passed, including "a broadcast consumer's closed() resolves once it closes". An earlier run alongsidejust kt checkpassed every test but then tripped the script's build-hook rebuild guard: the two checks sharetarget/. Run by itself, it passes.just kt check: passed.a broadcast consumer's closed returns once the broadcast ends[jvm]is inTEST-dev.moq.SmokeTest.xmlwith 0 failures.just swift check: skipped, because this Linux host has no Swift toolchain. CI covers it on macOS throughplatform.yml.quest check --base origin/main --branch quest/m2/binding-broadcast-end: passed.Follow-ups
None.
Review
Codex (
quest review), gpt-6.1-sol, medium effort. Round 1 of a new session reviewed headee0502a495c4d11e13546b9a1c310fd214494fb0againstorigin/main(a546cac082) and reported 0 findings. It ran from a local branch, because another worktree hasquest/m2/binding-broadcast-endchecked out. The earlier round 1 on4e74e9a61aalso reported 0 findings. Online reviewers (OpenAI review, Pullfrog) found no issues on4e74e9a61a. CodeRabbit hit its rate limit.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)