server/group: replace tautological assertion with require.NotPanics

This commit is contained in:
fatedier
2026-03-08 18:19:12 +08:00
parent 0125ca9437
commit 2de56556d9

View File

@@ -95,7 +95,8 @@ func TestConcurrentGetOrCreateAndRemoveIf(t *testing.T) {
}
wg.Wait()
// After all goroutines finish, the key either exists or not — no panic or race.
_, ok := r.get("k")
require.True(t, ok || !ok) // just verifying no panic
// After all goroutines finish, accessing the key must not panic.
require.NotPanics(t, func() {
_, _ = r.get("k")
})
}