Skip to content

test(proxycall): improve non-blocking test with slow logger#20

Open
samcm wants to merge 1 commit intomasterfrom
feat/improve-non-blocking-test
Open

test(proxycall): improve non-blocking test with slow logger#20
samcm wants to merge 1 commit intomasterfrom
feat/improve-non-blocking-test

Conversation

@samcm
Copy link
Member

@samcm samcm commented Jan 16, 2026

Summary

  • Replace TestClientResponseNotBlockedBySlowRequestBody with TestClientResponseNotBlockedBySlowLogging
  • Uses a slow logger (200ms delay) instead of slow request body to properly verify non-blocking behavior
  • Asserts client receives response before logging completes

Why

The previous test was flawed - a slow request body also delays the upstream from receiving the request, so it couldn't prove the snooper wasn't adding latency.

Test Results

Client received response in: 836µs
Request logged at: 202ms

Client receives response 240x faster than logging completes.

Replace TestClientResponseNotBlockedBySlowRequestBody with
TestClientResponseNotBlockedBySlowLogging which properly verifies
non-blocking behavior by:
- Using a slow logger (200ms delay on request logging)
- Verifying client receives response in <1ms
- Asserting client response time < logging delay

The previous test was flawed because slow request body also delays
the upstream from receiving the request, so it couldn't prove the
snooper wasn't adding latency.
@samcm samcm requested a review from pk910 as a code owner January 16, 2026 07:49
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