- Notifications
You must be signed in to change notification settings - Fork927
chore: add unit test for X11 eviction#18565
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
base:spike/18263-x11-network
Are you sure you want to change the base?
Conversation
spikecurtis commentedJun 25, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stackon Graphite.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
b60589d
to212e2a5
Compare7f2e241
toa68240d
Compare212e2a5
toa272b09
Comparea68240d
to0d55551
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice test!
return-1,false | ||
} | ||
ctx:=slog.With(sshCtx,slog.F("session_id",fmt.Sprintf("%x",serverConn.SessionID()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is an under-appreciated feature of slog, nice to see it in action!
deferclose(done) | ||
err:=s.Serve(ln) | ||
assert.Error(t,err)// Server is closed once we call s.Close(). | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Suggestion:testutil.Go
// Calculate how many simultaneous X11 sessions we can create given the | ||
// configured port range. | ||
startPort:=agentssh.X11StartPort+agentssh.X11DefaultDisplayOffset | ||
maxSessions:=agentssh.X11MaxPort-startPort+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Suggestion: If we madeagentssh.X11MaxPort
an option rather than constant, we could decrease the number sessions we have to create. This is definitely an optional suggestion, though.
a272b09
toe2d3899
Compare0d55551
to1153c62
Compare
Uh oh!
There was an error while loading.Please reload this page.
relates to#18263
Adds a unit test for X11 listener eviction when all ports in the allowed range are in use.