Repository navigation
refactor(host): cut the viewer connection and terminal seams - #2837
Open
fpresta0607 wants to merge 4 commits into
Open
fpresta0607 wants to merge 4 commits into
fpresta0607 wants to merge 4 commits into
Conversation
The host's run loop, its serving of viewers, its client and its delivery were written against a Windows named pipe and pseudo console, so a Linux host would have to copy them. The viewer connection and the terminal are now small interfaces, and everything that needs no Windows call moves to untagged files unchanged, leaving the pipe, the pseudo console's start and the launch in the Windows files. Tests of serving on a fake terminal and an in-memory connection now run on every system.
The new host tests bounded each wait to 10 s, under the 30 s floor the repository's stall check sets for a bound that only keeps a hung test from waiting forever, so the check failed on every system. The bound times nothing, so it is a minute, as the package's other waits are.
This branch has not been deployed
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.
What Changed
hostConnectionandterminalinterfaces in a new platform-neutralinternal/host/host.go, and moved the serving logic out ofhost_windows.gointo it:RunArgs, handshake and farewell timeouts,greet,serve,Answer, and a newrunTerminalthat drives aterminalover connections from an injectedacceptfunction. The Windows pipe listener,serveStream,StreamViewerandStreamWriternow take ahostConnectioninstead of*os.File.client.go,delivery.goandscreen.gobuild on every platform (renamed from*_windows.go). The stubClient,Delivery,ReadScreenandAnswerinhost_other.goandstream_other.goare gone, so off Windows the shared code now runs and fails at adialPipestub that returns the not-ported error. One visible difference:ReadScreenoff Windows now prefixes that error withhost: read the screen of terminal <id>:.host_test.go, which uses a fake terminal andnet.Pipeconnections to test input from viewers and deliveries, resizes, exit codes, query answers, and handshake refusals. Addedhost_other_test.go, which checks thatDial,View,Watch,DialDelivery,AnswerandReadScreenreturn errors wrappingerrors.ErrUnsupportedoff Windows.Risk Assessment
Validation text withheld because intent publication is disabled. Full results remain in the local run record. Recorded finding counts by snapshot: Intent: final unavailable, rounds [1: unavailable]; Rebase: final unavailable, rounds [1: unavailable]; Review: final 1, rounds [1: 2, 2: 1]; Test: final 0, rounds [1: 0]; Document: final 0, rounds [1: 0]; Lint: final unavailable, rounds [1: unavailable]; gate.lint.tests-kept: final unavailable, rounds [1: unavailable]; Push: final unavailable, rounds [1: unavailable].
Pipeline
Updates from git push no-mistakes
Intent: completed
Rebase: completed
Review: completed
Test: completed
Document: completed
Lint: completed
gate.lint.tests-kept: completed
Push: completed