Skip to content

Fix a liveness bug in MockWebServer#8858

Merged
swankjesse merged 2 commits into
masterfrom
jwilson.0615.liveness
Jun 16, 2025
Merged

Fix a liveness bug in MockWebServer#8858
swankjesse merged 2 commits into
masterfrom
jwilson.0615.liveness

Conversation

@swankjesse

Copy link
Copy Markdown
Collaborator

It was possible to configure delays that would be honored after MockWebServer was shut down. With this fix any delay will be abandoned once the server is closed.

It was possible to configure delays that would be honored
after MockWebServer was shut down. With this fix any
delay will be abandoned once the server is closed.
Comment thread mockwebserver/src/main/kotlin/mockwebserver3/internal/SleepNanos.kt Outdated
…os.kt

Co-authored-by: Jake Wharton <jw@squareup.com>
if (policy.throttlePeriodNanos > 0L) {
result =
ThrottledSink(
socket = socket,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this review, but should we be aiming for all operations like this to be on okio socket?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe yeah!

@swankjesse
swankjesse merged commit db836de into master Jun 16, 2025
22 checks passed
@swankjesse
swankjesse deleted the jwilson.0615.liveness branch June 16, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants