Skip to content

Commit 6bf6603

Browse files
authored
Merge pull request #9492 from yyforyongyu/itest-flake-interceptor
itest: fix flake in `testForwardInterceptorRestart`
2 parents ce8cde6 + e45e1f2 commit 6bf6603

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

itest/lnd_forward_interceptor_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
357357
cfgs := [][]string{nil, nil, nil, nil}
358358

359359
// Open and wait for channels.
360-
_, nodes := ht.CreateSimpleNetwork(cfgs, p)
360+
chanPoints, nodes := ht.CreateSimpleNetwork(cfgs, p)
361361
alice, bob, carol, dave := nodes[0], nodes[1], nodes[2], nodes[3]
362362

363363
// Connect an interceptor to Bob's node.
@@ -424,6 +424,13 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
424424

425425
require.NoError(ht, restartAlice(), "failed to restart alice")
426426

427+
// Once restarted, we will wait until the reestabilishment of the links,
428+
// Alice=>Bob and Bob=>Carol, finish before calling the interceptors. We
429+
// check this by asserting that Carol is now aware of the two channels
430+
// being active again.
431+
ht.AssertChannelInGraph(carol, chanPoints[0])
432+
ht.AssertChannelInGraph(carol, chanPoints[1])
433+
427434
// We should get another notification about the held HTLC.
428435
packet = ht.ReceiveHtlcInterceptor(bobInterceptor)
429436

0 commit comments

Comments
 (0)