test: consolidate Go tests (#39962)

Consolidate all Go tests. Coverage is identical to before. Go tests are
around 5% faster while being 7% smaller. No non-test code is touched.
This commit is contained in:
silverwind authored and GitHub committed 2026-10-24 13:48:19 +00:00
1 parent ce7364e215
commit 8abda62312
388 files changed
+18410 -29561

No files matched your search

+14 -20
View File
@@ -41,29 +41,23 @@ func TestManager_AddContext(t *testing.T) {
func TestManager_Cancel(t *testing.T) {
pm := Manager{processMap: make(map[IDType]*process), next: 1}
ctx, _, finished := pm.AddContext(t.Context(), "foo")
defer finished()
for _, managerCancel := range []bool{true, false} {
ctx, cancel, finished := pm.AddContext(t.Context(), "foo")
defer finished()
pm.Cancel(GetPID(ctx))
if managerCancel {
pm.Cancel(GetPID(ctx))
} else {
cancel()
}
select {
case <-ctx.Done():
default:
assert.FailNow(t, "Cancel should cancel the provided context")
select {
case <-ctx.Done():
default:
assert.FailNow(t, "Cancel should cancel the provided context")
}
finished()
}
finished()
ctx, cancel, finished := pm.AddContext(t.Context(), "foo")
defer finished()
cancel()
select {
case <-ctx.Done():
default:
assert.FailNow(t, "Cancel should cancel the provided context")
}
finished()
}
func TestManager_Remove(t *testing.T) {