lnd_test+lntest: keep btcd debug logs from test run
Useful for debugging 🤷
This commit is contained in:
parent
3a2fd51f2f
commit
4d05e6bbd8
24
lnd_test.go
24
lnd_test.go
@ -12516,7 +12516,13 @@ func TestLightningNetworkDaemon(t *testing.T) {
|
||||
// setting of accepting non-standard transactions on simnet to reject them.
|
||||
// Transactions on the lightning network should always be standard to get
|
||||
// better guarantees of getting included in to blocks.
|
||||
args := []string{"--rejectnonstd", "--txindex"}
|
||||
logDir := "./.backendlogs"
|
||||
args := []string{
|
||||
"--rejectnonstd",
|
||||
"--txindex",
|
||||
"--debuglevel=debug",
|
||||
"--logdir=" + logDir,
|
||||
}
|
||||
handlers := &rpcclient.NotificationHandlers{
|
||||
OnTxAccepted: func(hash *chainhash.Hash, amt btcutil.Amount) {
|
||||
lndHarness.OnTxAccepted(hash)
|
||||
@ -12526,7 +12532,21 @@ func TestLightningNetworkDaemon(t *testing.T) {
|
||||
if err != nil {
|
||||
ht.Fatalf("unable to create mining node: %v", err)
|
||||
}
|
||||
defer btcdHarness.TearDown()
|
||||
defer func() {
|
||||
btcdHarness.TearDown()
|
||||
|
||||
// After shutting down the chain backend, we'll make a copy of
|
||||
// the log file before deleting the temporary log dir.
|
||||
logFile := logDir + "/" + harnessNetParams.Name + "/btcd.log"
|
||||
err := lntest.CopyFile("./output_btcd_chainbackend.log",
|
||||
logFile)
|
||||
if err != nil {
|
||||
fmt.Printf("unable to copy file: %v\n", err)
|
||||
}
|
||||
if err = os.RemoveAll(logDir); err != nil {
|
||||
fmt.Printf("Cannot remove dir %s: %v\n", logDir, err)
|
||||
}
|
||||
}()
|
||||
|
||||
// First create the network harness to gain access to its
|
||||
// 'OnTxAccepted' call back.
|
||||
|
Loading…
Reference in New Issue
Block a user