func TestContextCancel(t *testing.T) { ctx := t.Context() // Tests we don't leak this goroutine: go func() { <-ctx.Done() }() }