Skip to content

Commit e45e1f2

Browse files
committed
itest: fix flake in testForwardInterceptorRestart
We need to make sure the links are recreated before calling the interceptor, otherwise we'd get the following error, causing the test to fail. ``` 2025-02-07 15:01:38.991 [ERR] RPCS interceptor.go:624: [/routerrpc.Router/HtlcInterceptor]: fwd (Chan ID=487:3:0, HTLC ID=0) not found ```
1 parent ce8cde6 commit e45e1f2

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)