Skip to content

Commit fd045b9

Browse files
committed
itest: assert lit sub-server stops when lnd stops
1 parent 03d3f0e commit fd045b9

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

itest/litd_lnd_shutdown_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,22 @@ func testLitdSurvivesLndShutdown(ctx context.Context, net *NetworkHarness,
9191
}, defaultTimeout)
9292
require.NoError(t.t, err)
9393

94-
// litd itself must keep running after lnd has stopped. Check that the
95-
// LIT sub-server stays reachable and reports as running for a few
96-
// seconds, confirming it does not shut down shortly after lnd does.
94+
// litd's process itself must keep running after lnd has stopped: its
95+
// status endpoint stays reachable. The LIT sub-server is reported as no
96+
// longer running, since litd cannot function without lnd, but the
97+
// endpoint continuing to answer at all is what proves litd did not
98+
// cascade down with lnd. Check this holds for a few seconds.
9799
for i := 0; i < 3; i++ {
98100
resp, err := statusClient.SubServerStatus(
99101
ctxt, &litrpc.SubServerStatusReq{},
100102
)
101-
require.NoError(t.t, err)
103+
require.NoError(t.t, err, "litd status endpoint must stay "+
104+
"reachable after lnd stopped")
102105

103106
litStatus, ok := resp.SubServers[subservers.LIT]
104107
require.True(t.t, ok, "expected lit sub-server status")
105-
require.True(t.t, litStatus.Running, "litd should stay running")
108+
require.False(t.t, litStatus.Running, "litd sub-server should "+
109+
"be reported as stopped once lnd has stopped")
106110

107111
time.Sleep(time.Second)
108112
}

0 commit comments

Comments
 (0)