test(vulkan): skip purego allocation budgets under the race runtime
- commit
- 42dd2dd0fae364025744149d176cca44b88434b7
- author
- brice · · 2026-10-22 10:46 UTC
- parent
- e94e9da
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +22 -0
M internal/adapters/vulkan/capture_test.go +3 -0
| @@ -358,6 +358,9 @@ func openFDs(t *testing.T) int { | |||
| 358 | 358 | // slot keeps its sync file for every lease. No mock stands in the measured | |
| 359 | 359 | // closure. | |
| 360 | 360 | func TestCaptureCycleAllocations(t *testing.T) { | |
| 361 | + | if raceEnabled { | |
| 362 | + | t.Skip("allocation budgets are not stable under the race runtime") | |
| 363 | + | } | |
| 361 | 364 | for _, tc := range []struct { | |
| 362 | 365 | name string | |
| 363 | 366 | new func(*testing.T) *Renderer | |
| @@ -358,6 +358,9 @@ func openFDs(t *testing.T) int { | |||||
| 358 | // slot keeps its sync file for every lease. No mock stands in the measured | 358 | // slot keeps its sync file for every lease. No mock stands in the measured | ||
| 359 | // closure. | 359 | // closure. | ||
| 360 | func TestCaptureCycleAllocations(t *testing.T) { | 360 | func TestCaptureCycleAllocations(t *testing.T) { | ||
| 361 | + | if raceEnabled { | |||
| 362 | + | t.Skip("allocation budgets are not stable under the race runtime") | |||
| 363 | + | } | |||
| 361 | for _, tc := range []struct { | 364 | for _, tc := range []struct { | ||
| 362 | name string | 365 | name string | ||
| 363 | new func(*testing.T) *Renderer | 366 | new func(*testing.T) *Renderer | ||
A internal/adapters/vulkan/norace_test.go +5 -0
| @@ -0,0 +1,5 @@ | |||
| 1 | + | //go:build !race | |
| 2 | + | ||
| 3 | + | package vulkan | |
| 4 | + | ||
| 5 | + | const raceEnabled = false | |
| @@ -0,0 +1,5 @@ | |||||
| 1 | + | //go:build !race | |||
| 2 | + | ||||
| 3 | + | package vulkan | |||
| 4 | + | ||||
| 5 | + | const raceEnabled = false | |||
A internal/adapters/vulkan/race_test.go +8 -0
| @@ -0,0 +1,8 @@ | |||
| 1 | + | //go:build race | |
| 2 | + | ||
| 3 | + | package vulkan | |
| 4 | + | ||
| 5 | + | // raceEnabled: sync.Pool drops items at random under the race runtime, so the | |
| 6 | + | // allocation budgets of calls that go through purego cannot hold. perf-check | |
| 7 | + | // runs them without it. | |
| 8 | + | const raceEnabled = true | |
| @@ -0,0 +1,8 @@ | |||||
| 1 | + | //go:build race | |||
| 2 | + | ||||
| 3 | + | package vulkan | |||
| 4 | + | ||||
| 5 | + | // raceEnabled: sync.Pool drops items at random under the race runtime, so the | |||
| 6 | + | // allocation budgets of calls that go through purego cannot hold. perf-check | |||
| 7 | + | // runs them without it. | |||
| 8 | + | const raceEnabled = true | |||
M internal/adapters/vulkan/scene_perf_test.go +6 -0
| @@ -16,6 +16,9 @@ import ( | |||
| 16 | 16 | // A new scene Seq with one of two windows moved is a partial redraw seeded by | |
| 17 | 17 | // sceneDelta and allocates nothing either. | |
| 18 | 18 | func TestRenderSteadyStateAllocations(t *testing.T) { | |
| 19 | + | if raceEnabled { | |
| 20 | + | t.Skip("allocation budgets are not stable under the race runtime") | |
| 21 | + | } | |
| 19 | 22 | for _, tc := range []struct { | |
| 20 | 23 | name string | |
| 21 | 24 | transform ports.BufferTransform | |
| @@ -145,6 +148,9 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||
| 145 | 148 | // keeps one alloc of headroom for drivers whose import path differs. | |
| 146 | 149 | // Skipped without a GPU or /dev/udmabuf. | |
| 147 | 150 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |
| 151 | + | if raceEnabled { | |
| 152 | + | t.Skip("allocation budgets are not stable under the race runtime") | |
| 153 | + | } | |
| 148 | 154 | r, err := New(80, 32) | |
| 149 | 155 | if err != nil { | |
| 150 | 156 | t.Skipf("Vulkan unavailable: %v", err) | |
| @@ -16,6 +16,9 @@ import ( | |||||
| 16 | // A new scene Seq with one of two windows moved is a partial redraw seeded by | 16 | // A new scene Seq with one of two windows moved is a partial redraw seeded by | ||
| 17 | // sceneDelta and allocates nothing either. | 17 | // sceneDelta and allocates nothing either. | ||
| 18 | func TestRenderSteadyStateAllocations(t *testing.T) { | 18 | func TestRenderSteadyStateAllocations(t *testing.T) { | ||
| 19 | + | if raceEnabled { | |||
| 20 | + | t.Skip("allocation budgets are not stable under the race runtime") | |||
| 21 | + | } | |||
| 19 | for _, tc := range []struct { | 22 | for _, tc := range []struct { | ||
| 20 | name string | 23 | name string | ||
| 21 | transform ports.BufferTransform | 24 | transform ports.BufferTransform | ||
| @@ -145,6 +148,9 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||||
| 145 | // keeps one alloc of headroom for drivers whose import path differs. | 148 | // keeps one alloc of headroom for drivers whose import path differs. | ||
| 146 | // Skipped without a GPU or /dev/udmabuf. | 149 | // Skipped without a GPU or /dev/udmabuf. | ||
| 147 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | 150 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | ||
| 151 | + | if raceEnabled { | |||
| 152 | + | t.Skip("allocation budgets are not stable under the race runtime") | |||
| 153 | + | } | |||
| 148 | r, err := New(80, 32) | 154 | r, err := New(80, 32) | ||
| 149 | if err != nil { | 155 | if err != nil { | ||
| 150 | t.Skipf("Vulkan unavailable: %v", err) | 156 | t.Skipf("Vulkan unavailable: %v", err) | ||