itest: manage context timeout inside network harness

This is the last commit to refactor the context management such that all
the timeout are managed inside the network harness.
This commit is contained in:
yyforyongyu
2021-08-20 01:48:27 +08:00
parent d9e9238b0c
commit 5a94919b7e
13 changed files with 49 additions and 64 deletions

View File

@@ -464,8 +464,7 @@ func testSwitchOfflineDelivery(net *lntest.NetworkHarness, t *harnessTest) {
}
// First, disconnect Dave and Alice so that their link is broken.
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
if err := net.DisconnectNodes(ctxt, dave, net.Alice); err != nil {
if err := net.DisconnectNodes(dave, net.Alice); err != nil {
t.Fatalf("unable to disconnect alice from dave: %v", err)
}
@@ -485,8 +484,7 @@ func testSwitchOfflineDelivery(net *lntest.NetworkHarness, t *harnessTest) {
// Now, disconnect Dave from Alice again before settling back the
// payment.
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
if err := net.DisconnectNodes(ctxt, dave, net.Alice); err != nil {
if err := net.DisconnectNodes(dave, net.Alice); err != nil {
t.Fatalf("unable to disconnect alice from dave: %v", err)
}