fn/ContextGuard: test cancelling blocking context
Make sure WgWait() doesn't block.
This commit is contained in:
1 file changed
+6
@@ -298,6 +298,12 @@ func TestContextGuard(t *testing.T) {
|
|||||||
case <-time.After(time.Second):
|
case <-time.After(time.Second):
|
||||||
t.Fatalf("timeout")
|
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
|
// Test that if we add the CustomTimeoutCGOpt option, then the context
|
||||||
|
|||||||
Reference in new issue
Block a user