Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: refactor TestServer_X11 to use inproc networking#18564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
spikecurtis wants to merge1 commit intospike/testutil-in-proc-net
base:spike/testutil-in-proc-net
Choose a base branch
Loading
fromspike/18263-x11-network

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedJun 25, 2025
edited
Loading

relates to#18263

Refactors the x11Forwarder to accept a networkinginterface that we can fake out for testing. This isolates the unit tests from other processes listening in the port range used by X11 forwarding. This will become extremely important in up-stack PRs where we listen on every port in the range and need to control which ports have conflicts.

@spikecurtisGraphite App
Copy link
ContributorAuthor

spikecurtis commentedJun 25, 2025
edited
Loading

@spikecurtisspikecurtisforce-pushed thespike/testutil-in-proc-net branch from1e438a6 tob39371fCompareJune 25, 2025 10:37
@spikecurtisspikecurtisforce-pushed thespike/18263-x11-network branch fromb60589d to212e2a5CompareJune 25, 2025 10:37
// It is intended mainly for testing; production code uses the default
// implementation backed by the operating system networking stack.
type X11Network interface {
Listen(network, address string) (net.Listener, error)
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: It'd be nice to keep this as aListen(ctx, ...) as previously via ListenConfig.

if originPort == 0 {
p := X11StartPort + session.display
if p > math.MaxUint32 {
panic("overflow")
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should panic here as that risks killing the whole agent in the unlikely event that we don't have aTCPConn. Logging and closing the connection seems more appropriate especially considering the comment above "or non-TCP connections" suggesting it's not only for tests.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mafredrimafredrimafredri left review comments

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@spikecurtis@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp