detached 2d01baf

test(brokeripc): pin the broker client window and document pipe headroom limits

commit
2d01baf62ae0705be9cff095189b92e02fff36a1
author
brice · · 2026-10-08 10:40 UTC
parent
e8bf3a5
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +14 -3
M internal/adapters/brokeripc/pipe_test.go +14 -3
@@ -112,9 +112,11 @@ func TestStreamPipeCloseWithPreservesQueuedDataOnOrderlyClose(t *testing.T) {
112112 // TestStreamPipeHoldsAFullOutputWindow pins the client pipe headroom for the
113113 // session output window. A client claims protocol.MaxOutputWindow unacked
114114 // Output frames; with a terminal that is not draining, all of them may sit in
115-// this pipe at once. Overflow fails the whole stream (ErrStreamBackpressure),
116-// so the default bounds must hold that window of worst realistic frames: a
117-// near-full repaint of a 500x140 terminal is about 70 KB, i.e. two chunks.
115+// this pipe at once, and overflow fails the whole stream
116+// (ErrStreamBackpressure). The frame size is a typical text repaint: a
117+// near-full page of a 500x140 terminal measured about 70 KB. Uncompressed diff
118+// frames with per-cell truecolor SGR can be far larger (estimated near 1 MB at
119+// 300x80), and eight of those can still overflow the default 4 MiB bound.
118120 func TestStreamPipeHoldsAFullOutputWindow(t *testing.T) {
119121 const frameBytes = 72 << 10
120122 chunk := int(brokerwire.MaxStreamChunkBytes)
@@ -128,3 +130,12 @@ func TestStreamPipeHoldsAFullOutputWindow(t *testing.T) {
128130 }
129131 }
130132 }
133+
134+// TestClientStreamPrefersTheFullOutputWindow pins what a real broker-routed
135+// attachment reports: its carriage is a reliable stream, not a datagram link,
136+// so the client claims the full output window and frames pipeline.
137+func TestClientStreamPrefersTheFullOutputWindow(t *testing.T) {
138+ st, err := newClientStream(&client{}, 1)
139+ require.NoError(t, err)
140+ require.Equal(t, uint8(protocol.MaxOutputWindow), st.Capabilities().PreferredOutputWindow)
141+}
@@ -112,9 +112,11 @@ func TestStreamPipeCloseWithPreservesQueuedDataOnOrderlyClose(t *testing.T) {
112 // TestStreamPipeHoldsAFullOutputWindow pins the client pipe headroom for the112 // TestStreamPipeHoldsAFullOutputWindow pins the client pipe headroom for the
113 // session output window. A client claims protocol.MaxOutputWindow unacked113 // session output window. A client claims protocol.MaxOutputWindow unacked
114 // Output frames; with a terminal that is not draining, all of them may sit in114 // Output frames; with a terminal that is not draining, all of them may sit in
115-// this pipe at once. Overflow fails the whole stream (ErrStreamBackpressure),115+// this pipe at once, and overflow fails the whole stream
116-// so the default bounds must hold that window of worst realistic frames: a116+// (ErrStreamBackpressure). The frame size is a typical text repaint: a
117-// near-full repaint of a 500x140 terminal is about 70 KB, i.e. two chunks.117+// near-full page of a 500x140 terminal measured about 70 KB. Uncompressed diff
118+// frames with per-cell truecolor SGR can be far larger (estimated near 1 MB at
119+// 300x80), and eight of those can still overflow the default 4 MiB bound.
118 func TestStreamPipeHoldsAFullOutputWindow(t *testing.T) {120 func TestStreamPipeHoldsAFullOutputWindow(t *testing.T) {
119 const frameBytes = 72 << 10121 const frameBytes = 72 << 10
120 chunk := int(brokerwire.MaxStreamChunkBytes)122 chunk := int(brokerwire.MaxStreamChunkBytes)
@@ -128,3 +130,12 @@ func TestStreamPipeHoldsAFullOutputWindow(t *testing.T) {
128 }130 }
129 }131 }
130 }132 }
133+
134+// TestClientStreamPrefersTheFullOutputWindow pins what a real broker-routed
135+// attachment reports: its carriage is a reliable stream, not a datagram link,
136+// so the client claims the full output window and frames pipeline.
137+func TestClientStreamPrefersTheFullOutputWindow(t *testing.T) {
138+ st, err := newClientStream(&client{}, 1)
139+ require.NoError(t, err)
140+ require.Equal(t, uint8(protocol.MaxOutputWindow), st.Capabilities().PreferredOutputWindow)
141+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close