test: ensure integration tests use unique context timeouts for each assertion
This commit is contained in:
parent
bb310a3d0d
commit
57d87aef3b
@ -812,7 +812,7 @@ func checkChannelPolicy(policy, expectedPolicy *lnrpc.RoutingPolicy) error {
|
|||||||
// testUpdateChannelPolicy tests that policy updates made to a channel
|
// testUpdateChannelPolicy tests that policy updates made to a channel
|
||||||
// gets propagated to other nodes in the network.
|
// gets propagated to other nodes in the network.
|
||||||
func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
|
func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
|
||||||
timeout := time.Duration(time.Second * 5)
|
timeout := time.Duration(time.Second * 15)
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
// Launch notification clients for all nodes, such that we can
|
// Launch notification clients for all nodes, such that we can
|
||||||
@ -868,10 +868,12 @@ func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("alice didn't report channel: %v", err)
|
t.Fatalf("alice didn't report channel: %v", err)
|
||||||
}
|
}
|
||||||
|
ctxt, _ = context.WithTimeout(ctxb, time.Second*15)
|
||||||
err = net.Bob.WaitForNetworkChannelOpen(ctxt, chanPoint2)
|
err = net.Bob.WaitForNetworkChannelOpen(ctxt, chanPoint2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("bob didn't report channel: %v", err)
|
t.Fatalf("bob didn't report channel: %v", err)
|
||||||
}
|
}
|
||||||
|
ctxt, _ = context.WithTimeout(ctxb, time.Second*15)
|
||||||
err = carol.WaitForNetworkChannelOpen(ctxt, chanPoint2)
|
err = carol.WaitForNetworkChannelOpen(ctxt, chanPoint2)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("carol didn't report channel: %v", err)
|
t.Fatalf("carol didn't report channel: %v", err)
|
||||||
@ -962,6 +964,7 @@ func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("alice didn't report channel: %v", err)
|
t.Fatalf("alice didn't report channel: %v", err)
|
||||||
}
|
}
|
||||||
|
ctxt, _ = context.WithTimeout(ctxb, time.Second*15)
|
||||||
err = carol.WaitForNetworkChannelOpen(ctxt, chanPoint3)
|
err = carol.WaitForNetworkChannelOpen(ctxt, chanPoint3)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("bob didn't report channel: %v", err)
|
t.Fatalf("bob didn't report channel: %v", err)
|
||||||
@ -1024,8 +1027,8 @@ func testUpdateChannelPolicy(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint, false)
|
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint, false)
|
||||||
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
||||||
closeChannelAndAssert(ctxt, t, net, net.Bob, chanPoint2, false)
|
closeChannelAndAssert(ctxt, t, net, net.Bob, chanPoint2, false)
|
||||||
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint3, false)
|
|
||||||
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
||||||
|
closeChannelAndAssert(ctxt, t, net, net.Alice, chanPoint3, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// testOpenChannelAfterReorg tests that in the case where we have an open
|
// testOpenChannelAfterReorg tests that in the case where we have an open
|
||||||
|
Loading…
Reference in New Issue
Block a user