Skip to content

test(dtx): tidy channel_robust tests after #824 - #840

Open
danielpaulus wants to merge 1 commit into
mainfrom
fix/dtx-test-tidy
Open

test(dtx): tidy channel_robust tests after #824#840
danielpaulus wants to merge 1 commit into
mainfrom
fix/dtx-test-tidy

Conversation

@danielpaulus

Copy link
Copy Markdown
Owner

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:

  1. Drop TestUnknownReplyDoesNotBlock — it's a near-verbatim duplicate of TestChannelDispatch_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.

  2. Reshape TestLateReplyAfterTimeoutDoesNotBlockTestTimeoutCleansUpWaiterAndDefragmenter — the old version only re-asserted "non-blocking," which security: REST auth, path-traversal/TLS fixes, and DTX/testmanagerd/nskeyedarchiver crash guards #792's TestSendResponse_NilChannel_NoBlock already 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: removeResponseWaiter deregistering both responseWaiters and defragmenters on timeout / send-error (the leak fix). It still checks a late reply doesn't block the reader.

Kept as-is: TestDispatchDoesNotBlockWithoutConsumer and TestDispatchDropsOldestOnOverflow — the genuinely new coverage from #824.

go build ./..., go vet ./ios/dtx_codec/, and go test ./ios/dtx_codec/ -race all green.

🤖 Generated with Claude Code

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant