mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-29 17:19:33 +02:00
fn/ContextGuard: test cancelling blocking context
Make sure WgWait() doesn't block.
This commit is contained in:
parent
a388c1f39d
commit
865da9c525
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user