lnd/itest
Elle Mouton bfb12b1d81 graph/db: remove address loading from cached node iteration
ForEachNodeCached is now only used for topology-oriented traversal,
so the address-loading option forced one autopilot scoring path to
bypass the in-memory graph cache for data it did not consume. Remove
the withAddrs parameter and the associated SQL/KV address plumbing
so cached node iteration can consistently use the graph cache when
it is loaded.

Autopilot still requires peer addresses before opening channels.
That filtering remains in Agent.openChans via ForEachNode, where the
selected candidates' addresses are collected for ConnectToPeer. The
trade-off is that ForEachNodesChannels no longer excludes
addressless nodes from graph-wide scoring inputs such as median
channel size or centrality, which also feed lncli getnetworkinfo
statistics like graph diameter. In practice the only addressless
nodes our local view tends to know about are nodes with no public
channels (e.g. our own node or peers we share only private channels
with), so the impact on the reported stats should be negligible.
Active channel candidates remain address-filtered before dialing.
2026-05-07 16:29:12 -07:00
..
config.go itest: test "lnd --debuglevel=show" command 2024-11-19 12:44:57 -03:00
flakes.go itest: document flakeRaceInBitcoinClientNotifications 2025-03-21 08:06:19 +08:00
list_exclude_test.go itest: use prefixed sub-tests 2025-04-23 11:52:39 -03:00
list_off_test.go itest+lntest: migrate lntemp to lntest 2023-02-23 21:56:09 +08:00
list_on_test.go itest+input: add production taproot channel integration tests 2026-04-13 12:17:56 -07:00
lnd_access_perm_test.go itest+lntest: add more itest for accessman 2025-06-19 16:05:59 +08:00
lnd_amp_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_bump_fee.go lntest+itest: add testBumpFeeExternalInput 2025-05-26 19:41:24 +08:00
lnd_channel_backup_test.go multi: add SCB restore support for production taproot channels 2026-04-13 12:22:16 -07:00
lnd_channel_balance_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_channel_force_close_test.go itest: extend relevant itests to cover taproot chans final 2026-04-13 12:17:56 -07:00
lnd_channel_funding_fund_max_test.go itest: add fundMax with maxChanSize test 2026-01-13 10:54:55 -05:00
lnd_channel_funding_utxo_selection_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
lnd_channel_graph_test.go itest: check for config addrs precedence 2025-09-24 10:51:19 +01:00
lnd_channel_policy_test.go multi: increase min cltv delta to 24 2026-01-16 13:06:30 -08:00
lnd_coop_close_external_delivery_test.go itest: test imported address in coop close 2025-04-23 11:53:29 -03:00
lnd_coop_close_rbf_test.go lnwallet/chancloser: address lint and PR review feedback 2026-03-27 14:04:25 -07:00
lnd_coop_close_with_htlcs_test.go itest: test all combos of rbf close and taproot chans 2025-04-03 16:23:36 -07:00
lnd_custom_features.go itest: remove unnecessary channel close and node shutdown 2024-12-20 19:38:06 +08:00
lnd_custom_message_test.go itest: remove the use of standby nodes 2024-12-20 19:38:05 +08:00
lnd_delete_canceled_invoice_test.go itest: add the test for DeleteCanceledInvoice 2025-07-29 13:55:17 -03:00
lnd_estimate_on_chain_fee_test.go itest: estimate on-chain fee with selected inputs 2026-01-07 10:30:03 +01:00
lnd_estimate_route_fee_test.go itest: enhance testEstimateRouteFee with multi-LSP scenarios 2025-12-01 18:07:56 +01:00
lnd_etcd_failover_test.go itest: add itest covering the leader healthcheck 2024-08-01 19:04:10 +02:00
lnd_experimental_accountability.go server: remove accountability signal experiment period 2026-01-06 09:12:34 -05:00
lnd_forward_delete_test.go itest: add integration tests for DeleteForwardingHistory 2026-03-30 17:39:46 +02:00
lnd_forward_interceptor_test.go server: remove accountability signal experiment period 2026-01-06 09:12:34 -05:00
lnd_funding_test.go multi: fix lint and itest failures for production taproot channels 2026-04-13 12:21:42 -07:00
lnd_graph.go itest: add peer bootstrapping itest 2025-06-24 12:56:46 +02:00
lnd_graph_migration_test.go graph/db: remove address loading from cached node iteration 2026-05-07 16:29:12 -07:00
lnd_hold_invoice_force_test.go itest: remove old TODOs 2025-03-06 09:11:30 +08:00
lnd_hold_persistence_test.go lntest+itest: change the method signature of AssertPaymentStatus 2025-02-28 19:07:38 +08:00
lnd_htlc_test.go itest: remove unnecessary channel close and node shutdown 2024-12-20 19:38:06 +08:00
lnd_htlc_timeout_resolver_test.go multi: increase min cltv delta to 24 2026-01-16 13:06:30 -08:00
lnd_invoice_acceptor_test.go multi: rename experimental endorsement signal to accountable 2026-01-06 09:12:31 -05:00
lnd_invoice_migration_test.go itest: graph sql migration itest 2025-07-15 06:40:22 +02:00
lnd_macaroons_test.go lnrpc+rpcserver: add QoL flag for permission check 2025-07-21 13:07:43 +02:00
lnd_max_channel_size_test.go itest: remove unnecessary channel close and node shutdown 2024-12-20 19:38:06 +08:00
lnd_max_htlc_path_test.go itest: add payment test with max htlc restriction 2025-08-06 09:37:09 +02:00
lnd_max_htlcs_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_misc_test.go multi: Add bitcoind miner backend to lntest 2026-03-23 15:46:37 +01:00
lnd_mpp_test.go lntest+itest: change the method signature of AssertPaymentStatus 2025-02-28 19:07:38 +08:00
lnd_multi-hop-error-propagation_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_multi-hop-payments_test.go lnd+lnrpc: update fwdinghistory message 2025-06-06 12:21:46 +01:00
lnd_multi-hop_force_close_test.go multi: fix linter issues 2026-04-13 12:21:42 -07:00
lnd_network_test.go itest: move test testDisconnectingTargetPeer 2025-03-06 09:11:30 +08:00
lnd_neutrino_test.go itest: remove the use of standby nodes 2024-12-20 19:38:05 +08:00
lnd_no_etcd_dummy_failover_test.go itest: add itest covering the leader healthcheck 2024-08-01 19:04:10 +02:00
lnd_nonstd_sweep_test.go multi: Allow selecting miner backend in itest 2026-03-23 15:46:37 +01:00
lnd_onchain_test.go itest+lntest: fix flake in testListSweeps 2025-07-09 20:52:02 +03:00
lnd_onion_message_forward_test.go peer: gate onion message ingress on having an open channel 2026-04-15 13:23:50 -07:00
lnd_onion_message_test.go peer: gate onion message ingress on having an open channel 2026-04-15 13:23:50 -07:00
lnd_open_channel_test.go itest+input: add production taproot channel integration tests 2026-04-13 12:17:56 -07:00
lnd_payment_migration_test.go itest: add a payments db itest similar to invoices and graph 2026-03-17 21:42:24 +01:00
lnd_payment_test.go multi: fix linter issues 2026-04-13 12:21:42 -07:00
lnd_postgres_network_separation_test.go itest: cover postgres network separation 2026-04-10 12:03:55 +02:00
lnd_psbt_test.go multi: fix linter issues 2026-04-13 12:21:42 -07:00
lnd_quiescence_test.go itest+lncfg: test the quiescence timeout behaivor 2025-07-04 04:20:00 +08:00
lnd_recovery_test.go itest: fix misuse of MineBlocks and replace it with 2024-07-23 21:30:08 +08:00
lnd_remote_signer_test.go multi: fix linter issues 2026-04-13 12:21:42 -07:00
lnd_res_handoff_test.go itest: remove unnecessary channel close and node shutdown 2024-12-20 19:38:06 +08:00
lnd_rest_api_test.go itest: remove loop in wsTestCaseBiDirectionalSubscription 2024-12-20 19:38:07 +08:00
lnd_revocation_test.go Merge pull request #10715 from yyforyongyu/fix/ci-sweep-watchtower-flakes 2026-04-27 09:19:57 +08:00
lnd_route_blinding_test.go itest: fix flake in testIntroductionNodeError 2026-04-14 06:32:44 +02:00
lnd_routing_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_rpc_middleware_interceptor_test.go itest: add test for multiple read-only rpc mw 2026-03-16 17:00:55 -04:00
lnd_signer_test.go multi: context.Background() -> t.Context() 2025-08-30 14:13:44 -03:00
lnd_single_hop_invoice_test.go itest: update tests with timeout_seconds 2025-01-15 19:46:09 +05:30
lnd_sweep_test.go multi: increase min cltv delta to 24 2026-01-16 13:06:30 -08:00
lnd_switch_test.go chore: fix typo 2025-01-05 20:45:35 +08:00
lnd_taproot_test.go itest+lntest: add coordinator pattern test for combined nonce 2025-12-10 07:19:04 +02:00
lnd_test.go multi: Allow selecting miner backend in itest 2026-03-23 15:46:37 +01:00
lnd_trackpayments_test.go itest: add itest to test duplicate failure notification 2025-03-24 09:17:09 -05:00
lnd_wallet.go itest: add wallet-related itest 2025-04-17 09:32:28 +08:00
lnd_wallet_import_test.go itest: add a prefix before appending a subtest case 2024-12-20 19:38:13 +08:00
lnd_wallet_sync_test.go itest: add wallet_synced field integration test 2026-02-05 08:58:33 +01:00
lnd_watchtower_test.go Merge pull request #10715 from yyforyongyu/fix/ci-sweep-watchtower-flakes 2026-04-27 09:19:57 +08:00
lnd_wipe_fwdpkgs_test.go multi: enable closed-channel tombstones on KV-SQL backends 2026-05-04 09:46:32 -03:00
lnd_wumbo_channels_test.go itest: remove unnecessary channel close and node shutdown 2024-12-20 19:38:06 +08:00
lnd_zero_conf_test.go multi: use the "errors" package everywhere 2025-06-30 09:46:55 +02:00
log_check_errors.sh multi: move itest out of lntest 2023-02-23 21:56:08 +08:00
log_substitutions.txt lntest/itest: adds tests for fundmax flag of cli:openchannel 2023-04-05 23:09:12 +02:00
README.md itest: add readme 2023-02-23 21:56:12 +08:00

Integration Test

itest is a package that houses the integration tests made for lnd. This package builds test cases using the test framework lntest.

Add New Tests

To add a new test case, create a TestFunc and add it in list_on_test.go. Ideally, the Name should just be the snake case of the name used in TestFunc without the leading test and underscores. For instance, to test lnd's exporting channel backup, we have,

{
		Name:     "export channel backup",
		TestFunc: testExportChannelBackup,
}

The place to put the code of the TestFunc is case-specific. itest package has loosely defined a list of files to test different functionalities of lnd. The new test needs to be put into one of these files, otherwise, a new file needs to be created.

Run Tests

Run a single test case

To run a single test case, use make itest icase=$case, where case is the name defined in list_on_test.go, with spaces replaced with underscores(_).

# Run `testListChannels`.
make itest icase=list_channels

Run multiple test cases

There are two ways to run multiple test cases. One way is to use make itest icase=$cases, where cases has the format cases='(case|case|...)'. The case is the name defined in list_on_test.go, with spaces replaced with underscores(_).

# Run `testListChannels` and `testListAddresses` together.
make itest icase='(list_channels|list_addresses)'

Another way to run multiple cases is similar to how Go runs its tests - by simple regex matching. For instance, the following command will run three cases since they all start with the word list,

# Run `testListChannels`, `testListAddresses`, and `testListPayments` together.
make itest icase=list

Run all tests

To run all tests, use make itest without icase flag.

# Run all test cases.
make itest

Run tests in parallel

To run tests in parallel, use make itest-parallel. This command takes two special arguments,

  • tranches, specifies the number of parts the test cases will be split into.
  • parallel, specifies the number of threads to run in parallel. This value must be smaller than or equal to tranches.
# Split the tests into 4 parts, and run them using 2 threads.
make itest-parallel tranches=4 parallel=2

By default, itest-parallel splits the tests into 4 parts and uses 4 threads to run each of them.

Additional arguments

For both make itest and make itest-parallel, the following arguments are allowed,

  • timeout, specifies the timeout value used in testing.
  • dbbackend, specifies the database backend. Must be bbolt, etcd, or postgres, default to bbolt.
  • backend, specifies the chain backend to be used. Must be one of,
    • btcd, the default value.
    • neutrino
    • bitcoind
    • bitcoind notxindex
    • bitcoind rpcpolling
# Run a single test case using bitcoind as the chain backend and etcd as the
# database backend, with a timeout of 5 minutes.
make itest icase=list_channels backend=bitcoind dbbackend=etcd timeout=5m

# Run all test cases in parallel, using bitcoind notxindex as the chain backend
# and etcd as the database backend, with a timeout of 60 minutes for each
# parallel.
make itest-parallel backend="bitcoind notxindex" dbbackend=etcd timeout=60m