Commit 1b6213a
committed
htlcswitch: stop InvoiceRegistry in newMockRegistry cleanup
newMockRegistry started an InvoiceRegistry but never stopped it.
InvoiceRegistry internally starts two background goroutines —
invoiceEventLoop and the InvoiceExpiryWatcher mainLoop — that
run for the lifetime of the registry. Without a matching Stop()
call both goroutines leaked for every test that called
newMockRegistry, accumulating thousands of goroutines during
fuzzing.
Register a t.Cleanup to call registry.Stop() so both loops are
torn down when the test ends.1 parent 2f150c9 commit 1b6213a
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1022 | 1027 | | |
1023 | 1028 | | |
1024 | 1029 | | |
| |||
0 commit comments