test(dtx): tidy channel_robust tests after #824 - #840
Open
danielpaulus wants to merge 1 commit into
Open
Conversation
Follow-up to #824. Two changes to ios/dtx_codec/channel_robust_test.go: - Drop TestUnknownReplyDoesNotBlock: it duplicates TestChannelDispatch_ResponseNoWaiter_NoHang (from #792) — same 'reply for an unknown/nil waiter must not block' assertion. - Reshape TestLateReplyAfterTimeoutDoesNotBlock -> TestTimeoutCleansUpWaiterAndDefragmenter: the old version only re-asserted non-blocking (already covered by #792's TestSendResponse_NilChannel_NoBlock). The new version pins #824's actual new behavior — removeResponseWaiter deregistering BOTH responseWaiters and defragmenters on timeout/ send-error (the leak fix) — and still asserts a late reply doesn't block the reader. Keeps the two genuinely-new queue tests (TestDispatchDoesNotBlockWithoutConsumer, TestDispatchDropsOldestOnOverflow). go test ./ios/dtx_codec/ -race green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EJXoR6KAaEXEqzyJien7WJ
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.
Small follow-up to #824 (dtx non-blocking dispatch), doing the test cleanup we said we'd handle ourselves so the contributor didn't have to round-trip.
Two changes in
ios/dtx_codec/channel_robust_test.go:Drop
TestUnknownReplyDoesNotBlock— it's a near-verbatim duplicate ofTestChannelDispatch_ResponseNoWaiter_NoHang(added in security: REST auth, path-traversal/TLS fixes, and DTX/testmanagerd/nskeyedarchiver crash guards #792): both assert that a reply for an unknown/nil waiter doesn't block the reader goroutine.Reshape
TestLateReplyAfterTimeoutDoesNotBlock→TestTimeoutCleansUpWaiterAndDefragmenter— the old version only re-asserted "non-blocking," which security: REST auth, path-traversal/TLS fixes, and DTX/testmanagerd/nskeyedarchiver crash guards #792'sTestSendResponse_NilChannel_NoBlockalready covers. The new version pins the behavior fix(dtx): never block the connection reader goroutine in Channel.Dispatch #824 actually added and nothing else tested:removeResponseWaiterderegistering bothresponseWaitersanddefragmenterson timeout / send-error (the leak fix). It still checks a late reply doesn't block the reader.Kept as-is:
TestDispatchDoesNotBlockWithoutConsumerandTestDispatchDropsOldestOnOverflow— the genuinely new coverage from #824.go build ./...,go vet ./ios/dtx_codec/, andgo test ./ios/dtx_codec/ -raceall green.🤖 Generated with Claude Code