Commit Graph

25 Commits

Author SHA1 Message Date
Boris Nagaev
dee8ad3754 multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings.

This change was produced by:
 - running golangci-lint run --fix
 - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go`
 - manually fixing broken tests
 - itest, lntest: use ht.Context() where ht or hn is available
 - in HarnessNode.Stop() we keep using context.Background(), because it is
   called from a cleanup handler in which t.Context() is canceled already.
2025-08-30 14:13:44 -03:00
yyforyongyu
343ae963b0 lntest: add a new basedir flag to keep test data 2025-06-23 17:29:26 +08:00
yyforyongyu
0d20e96e96 lntest: create GenBaseDir to generate the base dir 2025-06-23 17:28:48 +08:00
ffranr
24ba098798 lntest: assert shutdown via logs only if log handle is present
Ensure shutdown assertions through log inspection are only performed
when the harness node has an active log file handle. This avoids
errors during shutdown when log file output is disabled.
2025-04-11 15:30:13 +01:00
yyforyongyu
5f4716c699 lntest: log timestamp when printing errors 2025-02-05 22:51:46 +08:00
yyforyongyu
31b66962d8 lntest: properly handle shutdown error
This commit removes the panic used in checking the shutdown log.
Instead, the error is returned and asserted in `shutdownAllNodes` so
it's easier to check which node failed in which test. We also catch all
the errors returned from `StopDaemon` call to properly access the
shutdown behavior.
2024-12-20 19:38:14 +08:00
yyforyongyu
f64b2ce8f2 lntest: make sure node is properly shut down
Soemtimes the node may be hanging for a while without being noticed,
causing failures in its following tests, thus making the debugging
extrememly difficult. We now assert the node has been shut down from the
logs to assert the shutdown process behaves as expected.
2024-12-20 19:38:06 +08:00
Olaoluwa Osuntokun
b9105c35e5 lntest: print node PID when launching in itests
In this commit, we start to print the PID of node's we created within an
itest. This is useful when debugging itests with `dlv` by attaching to a
given node. By printing out the PID, we facilitate such debugging
attempts.
2024-11-15 17:21:43 -08:00
yyforyongyu
2905e7b3df lntest+itest: kill node and wait its process
Fix a flake found in `testRPCMiddlewareInterceptor` when running in
macOS.
2024-11-12 23:55:40 +08:00
Oliver Gugger
e99e6662cf multi: update linter, fix new issues 2024-08-20 19:14:44 +02:00
erik
df4ddcc573 multi: replace ioutil.TempDir 2024-04-25 11:24:41 +02:00
erik
caf2419ff6 multi: replace ioutil.ReadDir 2024-04-25 11:24:17 +02:00
erik
ab83343c87 multi: repleace ioutil.ReadFile 2024-04-25 11:22:43 +02:00
Oliver Gugger
8ce3622792 Merge pull request #8590 from ffranr/test-node-name-in-tmpdir
lntest: add test node name to tmp directory name
2024-04-24 20:06:04 +02:00
Oliver Gugger
648fb22f63 multi: wrap all errors 2024-04-11 15:04:03 +02:00
ffranr
05db2c35df lntest: add test node name to tmp directory name
In this commit we add the LND node name to the temporary directory's
name. This change makes it easier to identify a particular test node's
temporary directory.

This commit also replaces the depreciated `ioutil.TempDir` function call
with `os.MkdirTemp`.
2024-03-26 18:28:41 +00:00
Andras Banki-Horvath
2fbffab421 itest: ensure that native SQL LND won't start if it has any KV invoices 2024-03-20 08:46:48 +01:00
Slyghtning
ef069b658d itest: preparatory fee estimation changes 2024-03-05 09:24:27 +01:00
ffranr
cd566eb097 multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
Elle Mouton
1211e7eb7b multi: use "bitcoin" chain name constant
Make use of the `bitcoinChainName` constant instead of re-writing the
"bitcoin" string.
2023-10-06 16:34:47 -07:00
yyforyongyu
4bbb4ed978 lntest: skip killing dead process 2023-05-09 21:41:53 +08:00
yyforyongyu
24c028ff52 lntest: make sure error from shutdown is caught 2023-04-20 18:52:46 +08:00
yyforyongyu
28744d89c7 lntest: fix linter stylecheck and containedctx 2023-02-24 01:35:16 +08:00
yyforyongyu
2bc6aabf96 itest: fix make lint
This commit fixes the issues reported by the linter.
2023-02-23 21:56:10 +08:00
yyforyongyu
9d1d629001 itest+lntest: migrate lntemp to lntest
This commit performs the takeover that `lntemp` is now promoted to be
`lntest`, and the scaffolding is now removed as all the refactoring is
finished!
2023-02-23 21:56:09 +08:00