Skip to content

Decouple test reporter IO from test execution#3962

Merged
alexcrocha merged 1 commit intomainfrom
02-17-decouple_test_reporter_io_from_test_execution
Feb 19, 2026
Merged

Decouple test reporter IO from test execution#3962
alexcrocha merged 1 commit intomainfrom
02-17-decouple_test_reporter_io_from_test_execution

Conversation

@alexcrocha
Copy link
Contributor

@alexcrocha alexcrocha commented Feb 18, 2026

Motivation

This PR solves the LspReporter's IO bottleneck (as identified in #3843) by decoupling socket writes from test execution. When the reporter is active, every test result blocks the test thread until the OS completes a socket write. For suites with many fast tests, this IO overhead becomes the bottleneck and can degrade test runtime.

Implementation

send_message now pushes to a Thread::Queue instead of writing to the socket directly. A background writer thread pops messages from the queue and writes them to the socket, so the test thread never blocks on IO.

Shutdown uses Queue#close to signal the writer thread that no more messages will be enqueued, allowing it to exit after processing the remaining ones.

Automated Tests

The existing tests should continue to pass with this change as the external behaviour remains the same.

Copy link
Contributor Author


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

To reduce test reporter overhead on large test suites, we can buffer
socket writes so the test thread never blocks on IO
@alexcrocha alexcrocha force-pushed the 02-17-decouple_test_reporter_io_from_test_execution branch from cac8b96 to 4ed1af0 Compare February 19, 2026 01:05
@alexcrocha alexcrocha added the server This pull request should be included in the server gem's release notes label Feb 19, 2026
@alexcrocha alexcrocha marked this pull request as ready for review February 19, 2026 01:15
@alexcrocha alexcrocha requested a review from a team as a code owner February 19, 2026 01:15
@alexcrocha alexcrocha added the other Changes that aren't bugfixes, enhancements or breaking changes label Feb 19, 2026
@alexcrocha alexcrocha merged commit 0831266 into main Feb 19, 2026
38 of 42 checks passed
@alexcrocha alexcrocha deleted the 02-17-decouple_test_reporter_io_from_test_execution branch February 19, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments