Add FileHandle.read(until:) to avoid blocking on slow exit test events.#1782
Merged
Conversation
…nts. If an exit test runs for a long time, we necessarily block until it terminates before the calling task resumes. We also wait until the end of the exit test to consume any events from its event stream (by calling `FileHandle.readToEnd()` and thus waiting for the write end of the pipe to close). This PR breaks up reading from the exit test's event stream so that we read one line at a time, then yield before processing the event. The result is that we process events sooner after they occur and we allow other tasks to use the thread we're camped on at least for a little bit of time.
stmontgomery
approved these changes
Jul 10, 2026
Contributor
Author
|
Linux failures are known issues. |
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.
If an exit test runs for a long time, we necessarily block until it terminates before the calling task resumes. We also wait until the end of the exit test to consume any events from its event stream (by calling
FileHandle.readToEnd()and thus waiting for the write end of the pipe to close).This PR breaks up reading from the exit test's event stream so that we read one line at a time, then yield before processing the event. The result is that we process events sooner after they occur and we allow other tasks to use the thread we're camped on at least for a little bit of time.
I'll also be able to use
read(until:)in the harness.Checklist: