detached 55e2634

test: skip mock-relative allocation budgets under the race detector

CI failed TestCommitFrameAllocations under make race: the commit counted
3.05 allocations over the mocked call, past its margin of 3, while the
race runtime moves testify's own count by 2 to 3 per call. The
TestCommitDamageAllocations budget of 0 also failed once in a full race
run from a background allocation. Both skip under -race; perf-check
still runs them without it, and the exact zero-allocation subtest of
the commit keeps running under -race.
commit
55e2634bf2c902f85bde787fcdbfa2277455e869
author
brice · · 2026-10-14 04:23 UTC
committer
brice · · 2026-10-14 04:34 UTC
parent
ffe1c25
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +23 -0
M internal/adapters/drm/commit_alloc_test.go +6 -0
@@ -53,6 +53,12 @@ func TestCommitFrameAllocations(t *testing.T) {
5353 }
5454 })
5555 t.Run("success path", func(t *testing.T) {
56+ if raceEnabled {
57+ // The race runtime moves testify's count by a few
58+ // allocations per call, as much as the margin below.
59+ // perf-check runs it without; the subtest above stays exact.
60+ t.Skip("testify allocates unevenly under the race detector")
61+ }
5662 o, c := scanoutAllocsOutput(t)
5763 k := newMockkms(t)
5864 k.EXPECT().commit(mock.Anything, mock.Anything, mock.Anything).Return(nil)
@@ -53,6 +53,12 @@ func TestCommitFrameAllocations(t *testing.T) {
53 }53 }
54 })54 })
55 t.Run("success path", func(t *testing.T) {55 t.Run("success path", func(t *testing.T) {
56+ if raceEnabled {
57+ // The race runtime moves testify's count by a few
58+ // allocations per call, as much as the margin below.
59+ // perf-check runs it without; the subtest above stays exact.
60+ t.Skip("testify allocates unevenly under the race detector")
61+ }
56 o, c := scanoutAllocsOutput(t)62 o, c := scanoutAllocsOutput(t)
57 k := newMockkms(t)63 k := newMockkms(t)
58 k.EXPECT().commit(mock.Anything, mock.Anything, mock.Anything).Return(nil)64 k.EXPECT().commit(mock.Anything, mock.Anything, mock.Anything).Return(nil)
A internal/adapters/drm/norace_test.go +5 -0
@@ -0,0 +1,5 @@
1+//go:build !race
2+
3+package drm
4+
5+const raceEnabled = false
@@ -0,0 +1,5 @@
1+//go:build !race
2+
3+package drm
4+
5+const raceEnabled = false
A internal/adapters/drm/race_test.go +7 -0
@@ -0,0 +1,7 @@
1+//go:build race
2+
3+package drm
4+
5+// raceEnabled: the race runtime changes allocation counts, which budgets
6+// measured against a mocked call cannot tell apart from a regression.
7+const raceEnabled = true
@@ -0,0 +1,7 @@
1+//go:build race
2+
3+package drm
4+
5+// raceEnabled: the race runtime changes allocation counts, which budgets
6+// measured against a mocked call cannot tell apart from a regression.
7+const raceEnabled = true
M internal/adapters/wayland/alloc_hotpath_test.go +5 -0
@@ -23,6 +23,11 @@ func TestReleaseHeldAllocations(t *testing.T) {
2323 }
2424
2525 func TestCommitDamageAllocations(t *testing.T) {
26+ if raceEnabled {
27+ // AllocsPerRun counts every goroutine, and the race runtime
28+ // allocates on its own now and then. perf-check runs it without.
29+ t.Skip("the race detector allocates in the background")
30+ }
2631 srv := &Server{fifoSurfaces: map[*surface]struct{}{}}
2732 surf := &surface{server: srv}
2833 commit := func() {
@@ -23,6 +23,11 @@ func TestReleaseHeldAllocations(t *testing.T) {
23 }23 }
24 24
25 func TestCommitDamageAllocations(t *testing.T) {25 func TestCommitDamageAllocations(t *testing.T) {
26+ if raceEnabled {
27+ // AllocsPerRun counts every goroutine, and the race runtime
28+ // allocates on its own now and then. perf-check runs it without.
29+ t.Skip("the race detector allocates in the background")
30+ }
26 srv := &Server{fifoSurfaces: map[*surface]struct{}{}}31 srv := &Server{fifoSurfaces: map[*surface]struct{}{}}
27 surf := &surface{server: srv}32 surf := &surface{server: srv}
28 commit := func() {33 commit := func() {

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 25

Tags 10

↑↓ moveenter openesc close