Commit 1040228a52

1040228a5264a29297bda6b13b1c55beeeb8a57a

parent: 7f779fb152

Verified · cmc ci/build: success ci/test: success

cmc <hello@cleberg.net> · 2026-10-02 04:50 UTC

control: screen test fixtures skip the write limiter

The limiter is global to the package and keyed on user 1 in every
fixture; the fixtures' writes pushed TestStatusSetRefusesReservedContext
over it on CI.

Ref #319

Layout: unified · split

internal/control/stage3repo_test.go +6
@@ -27,6 +27,9 @@ func dispatchIn(t *testing.T, st *store.Store, u store.User, root, stdin string,
2727 out, errOut := &bytes.Buffer{}, &bytes.Buffer{}
2828 c := &Ctx{User: u, Scope: "full", Store: st, Stdout: out, Stderr: errOut, Stdin: strings.NewReader(stdin)}
2929 c.Cfg.Server.Root = root
30 // Fixtures write a lot as user 1; the write limiter is global to
31 // the package, so leave its budget to the tests that exercise it.
32 c.Cfg.Limits.WriteRate = -1
3033 if code := Dispatch(c, argv); code != protocol.ExitOK {
3134 t.Fatalf("%v: exit %d: %s", argv, code, errOut)
3235 }
@@ -46,6 +49,9 @@ func atTerminalIn(t *testing.T, st *store.Store, u store.User, root string, argv
4649 out, errOut := &bytes.Buffer{}, &bytes.Buffer{}
4750 c := &Ctx{User: u, Scope: "full", Store: st, Stdout: out, Stderr: errOut, Stdin: strings.NewReader(""), Term: Term{Cols: 100}}
4851 c.Cfg.Server.Root = root
52 // Fixtures write a lot as user 1; the write limiter is global to
53 // the package, so leave its budget to the tests that exercise it.
54 c.Cfg.Limits.WriteRate = -1
4955 if code := Dispatch(c, argv); code != protocol.ExitOK {
5056 t.Fatalf("%v: exit %d: %s", argv, code, errOut)
5157 }