chore: add unit test for X11 eviction#18565
Merged
Merged
Conversation
This was referenced Jun 25, 2025
Contributor
Author
This was referenced Jun 25, 2025
b60589d to
212e2a5
Compare
7f2e241 to
a68240d
Compare
212e2a5 to
a272b09
Compare
a68240d to
0d55551
Compare
mafredri
approved these changes
Jun 27, 2025
| x.logger.Warn(sshCtx, "failed to get server connection") | ||
| return -1, false | ||
| } | ||
| ctx := slog.With(sshCtx, slog.F("session_id", fmt.Sprintf("%x", serverConn.SessionID()))) |
Member
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
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
Contributor
Author
Merge activity
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

relates to #18263
Adds a unit test for X11 listener eviction when all ports in the allowed range are in use.