-
Notifications
You must be signed in to change notification settings - Fork 927
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b60589d
to
212e2a5
Compare
7f2e241
to
a68240d
Compare
212e2a5
to
a272b09
Compare
a68240d
to
0d55551
Compare
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.
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!
// 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 made agentssh.X11MaxPort
an option rather than constant, we could decrease the number sessions we have to create. This is definitely an optional suggestion, though.
a272b09
to
e2d3899
Compare
1153c62
to
8a1e923
Compare
e2d3899
to
f3ebe91
Compare
8a1e923
to
fb1e1bb
Compare
f3ebe91
to
449c022
Compare
fb1e1bb
to
1d279c8
Compare
702c154
to
011e763
Compare
1d279c8
to
3275c03
Compare
3275c03
to
b4283f8
Compare
011e763
to
a5bfb20
Compare
b4283f8
to
a6ab9a1
Compare
Merge activity
|
relates to #18263
Adds a unit test for X11 listener eviction when all ports in the allowed range are in use.