Skip to content

Commit

Permalink
fixup! clightning: add shutdown hook for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
YusukeShimizu committed Nov 15, 2024
1 parent 22cdafa commit e2095fc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/bitcoin_cln_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,3 +1218,33 @@ func Test_ClnCln_StuckChannels(t *testing.T) {
err := lightningds[1].Rpc.Request(&clightning.SwapIn{SatAmt: 100, ShortChannelId: params.scid, Asset: "btc"}, &response)
assert.Error(t, err)
}

func Test_Cln_shutdown(t *testing.T) {
IsIntegrationTest(t)
t.Parallel()
require := require.New(t)
bitcoind, lightningds, _ := clnclnSetup(t, uint64(math.Pow10(9)))
defer func() {
if t.Failed() {
filter := os.Getenv("PEERSWAP_TEST_FILTER")
pprintFail(
tailableProcess{
p: bitcoind.DaemonProcess,
lines: defaultLines,
},
tailableProcess{
p: lightningds[0].DaemonProcess,
filter: filter,
lines: defaultLines,
},
tailableProcess{
p: lightningds[1].DaemonProcess,
lines: defaultLines,
},
)
}
}()
lightningds[0].Shutdown()
require.NoError(lightningds[0].WaitForLog(
"plugin-peerswap: Killing plugin: exited during normal operation", 30))
}

0 comments on commit e2095fc

Please sign in to comment.