fn/ContextGuard: test cancelling blocking context

Make sure WgWait() doesn't block.
This commit is contained in:
Boris Nagaev 2024-12-14 00:43:11 -03:00
parent a388c1f39d
commit 865da9c525
No known key found for this signature in database

View File

@ -298,6 +298,12 @@ func TestContextGuard(t *testing.T) {
case <-time.After(time.Second):
t.Fatalf("timeout")
}
// Cancel the context.
cancel()
// Make sure wg's counter gets to 0 eventually.
g.WgWait()
})
// Test that if we add the CustomTimeoutCGOpt option, then the context