Commit Graph

418 Commits

Author SHA1 Message Date
Oliver Gugger
24adf475ce
lnd_test: add integration tests for stateless init 2020-11-07 11:24:35 +01:00
Oliver Gugger
a606f462bc
itest: move longest test to beginning
To make sure the test that takes the longest overall time is always
started first, independent of the number of test tranches we run, we
move it to the beginning of the list. Because that test involves a lot
of waiting, it allows us to play around with the number of tranches more
efficiently.
2020-11-04 11:03:37 +01:00
Oliver Gugger
e6c47294fb
itest: fix typo and formatting 2020-11-04 11:03:36 +01:00
Oliver Gugger
ea4bb5dc5c
itest: fix chanbackup restore flake
Updating the fee of the mock estimator _after_ starting carol turned out
to be flaky and could lead to the new fee not being picked up in time
for the force close. That lead to carol not cpfp'ing the force closed
transaction.
2020-11-04 11:03:34 +01:00
Oliver Gugger
ca7564e4b4
itest: add flags for lnd executable 2020-11-04 11:03:31 +01:00
Oliver Gugger
f358a4474d
lntest: add log dir flag 2020-11-04 11:03:30 +01:00
Oliver Gugger
9bbf134237
itest: split tests into dynamic tranches 2020-11-04 11:03:29 +01:00
Oliver Gugger
891eb0d63d
lntest: use nextAvailablePort for bitcoind 2020-11-04 11:03:27 +01:00
Oliver Gugger
5c04449dfd
lntest: use nextAvailablePort for fee service 2020-11-04 11:03:26 +01:00
Oliver Gugger
a50d337e42
lntest: lower initial port, add ApplyPortOffset function
To allow running multiple test tranches in parallel, we need a way to
make sure the TCP ports don't collide. We'll work with offsets for the
ports, using a different offset for each tranche.
2020-11-04 11:03:25 +01:00
Eugene
225390ab5b
Merge pull request #4487 from Crypt-iQ/cc_pkg_0723
chainreg: new chainreg package
2020-10-30 06:07:26 -04:00
Eugene
bebe258e2d chainregistry+lnd: moving chainregistry+chainparams to new package 2020-10-29 15:24:14 -04:00
Matheus Degiovani
835c73632b
itest: fix off-by-one mining tests
This fixes tests that were surfaced as flaky.  Usually these tests had
an off-by-one error when mining blocks while waiting for a
CSV-encumbered output.
2020-10-28 14:48:15 -03:00
Oliver Gugger
098598ec74
itest: sort error whitelist 2020-10-28 14:35:11 +01:00
Oliver Gugger
fd684a8ffa
itest: add new errors to whitelist 2020-10-28 14:35:10 +01:00
Oliver Gugger
34439fbc2a
itest: cleanup multi-hop tests
As a preparation to fix an issue with the mempool wait, we clean up the
multi-hop itests a bit. We fix the formatting, use the require library
for assertions consistently and simplify some of the wait predicates.
Commonly used code is also extracted into functions.
2020-10-28 13:38:04 +01:00
Oliver Gugger
d1b46211d8
itest: replace WaitForTxBroadcast with WaitForTxInMempool 2020-10-28 13:29:18 +01:00
Oliver Gugger
1714394add
itest: fix send payment flake
In some cases the router isn't yet fully aware of all newly opened
channels. We need to give it some time to process the updates. Therefore
we add a wait for sending payments to give it a few more changes to
catch up.
2020-10-28 13:22:48 +01:00
Oliver Gugger
e6b0141b10
itest: fix typos, formatting 2020-10-28 13:22:48 +01:00
Matheus Degiovani
16a4687718
itest: Fix flakes when payments cause chan closure
This fixes itest flakes that happen when a payment is attempted that
ends up causing a channel closure.

completePaymentRequests() attempts to monitor the open channels after a
payment is attempted in order to identify that payment was actually
dispatched to a remote node before returning.

However, when the payment actually causes a channel closure (for
example, because the receiver sent an incorrect preimage) this logic
fails in that the channel will no longer the found in the list of open
channels. This could cause a flake when there was enough time for the
channel to close before performing the check.

One example of such a flaky test is failing_link.

This fixes the issue by also checking whether the total number of
channels was reduced, which indicates (assuming itest operations are
being executed serially) that one of the attempted payments affected at
least one channel.
2020-10-27 08:07:49 -03:00
Matheus Degiovani
473f730eec
itest: Sync nodes to chain during singleHop tests
This ensures the Carol and Dave nodes created in the single_hop series
of tests are synced to the latest chain tip generated by the miner
before creating the route that will eventually be used for payments.

This prevents a flake during CI tests where slow processing of blocks by
Carol could cause the generated route to have a final CLTV delta too
short for Dave to accept.

While at it, we switch the test to use the default CLTV delta provided
by QueryRoutes which is now the global default CLTV.
2020-10-26 16:29:39 -03:00
Oliver Gugger
3e3618ae9a
lntest: add build flag for disabling txindex on bitcoind
We create a new build flag for running the bitcoind tests without the
txindex enabled. We don't want this to be the default so we use a
negated build flag.
2020-10-09 13:35:04 +02:00
Oliver Gugger
b7fc7c3dae
lntest: use extraArgs, fix linter issues 2020-10-09 13:35:02 +02:00
Oliver Gugger
43c2031fa8
lntest: extract common bitcoind code into own file
To prepare for running multiple tests on bitcoind with different options
each time, we extract the common code into its own file.
2020-10-09 13:35:00 +02:00
Oliver Gugger
eb74011d5a
itest: add error to whitelist 2020-10-08 20:39:11 +02:00
Oliver Gugger
eb280fd248
itest: use new PSBT functions for funding flow
Now that we have all functions that we need to complete the whole
PSBT channel funding flow, we change the itest to use Dave's wallet
to fund the channel from Carol to Dave through a PSBT.
2020-10-03 10:34:56 +02:00
Oliver Gugger
f114fb3c8d
itest: use require library
We rewrite the test to use the require library to make it a
bit more condensed.
2020-10-03 10:34:56 +02:00
Oliver Gugger
f947576f33
lnwallet+mock: add new PSBT methods 2020-10-03 10:34:39 +02:00
Johan T. Halseth
ef0bca7a8e
Merge pull request #4660 from yyforyongyu/add-temp-miner-logs
itest: save temp miner's logs
2020-10-02 12:43:22 +02:00
Johan T. Halseth
1a73bc7d74
Merge pull request #4653 from LN-Zap/feat/spend-unconfirmed
Ability to spend unconfirmed coins when making onchain transactions
2020-10-02 08:40:45 +02:00
yyforyongyu
310f87e271
itest: save temp miner's logs 2020-10-02 00:04:47 +08:00
Tom Kirkpatrick
73a5f325b6
lnrpc: ability to spend unconfirmed coins 2020-10-01 13:27:03 +01:00
yyforyongyu
089e7557be
itest: update log error whitelist 2020-09-29 05:55:36 +08:00
Conner Fromknecht
68ddba7cb7
Merge pull request #4512 from yyforyongyu/channel-balance-verbose
display verbose result in ChannelBalance
2020-09-25 13:31:01 -07:00
Johan T. Halseth
74e62e5c5b
Merge pull request #4589 from yyforyongyu/itest-proper-cleanup
Itest: proper connect/disconnect miner
2020-09-25 10:31:56 +02:00
yyforyongyu
86779fb6a5
itest: fix code lint 2020-09-24 20:51:58 +08:00
yyforyongyu
48f6c47b17
itest: test all ChannelBalance fields 2020-09-24 20:33:23 +08:00
yyforyongyu
1b200c9930
itest: explicit checking ChannelBalance response 2020-09-24 20:30:51 +08:00
Oliver Gugger
9f7d8dd92e
lntest: make compilable without subserver build tags
To make it possible to compile the itests together with the other tests,
we don't want to use anything from the optional subservers.
2020-09-21 21:16:32 +02:00
Olaoluwa Osuntokun
719e32830d
lntest: fix most linter warnings, silence rest
We fix all linter issues except for the 'lostcontext' and 'unparam' ones
as those are too numerous and would increase the diff even more.
Therefore we silence them in the itest directory for now.
Because the linter is still not build tag aware, we also have to silence
the unused and deadcode sub linters to not get false positives.
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
c769247198
lntest: allow the main test files to be buildable w/o the rpctest build tag
In this commit, we modify our build tag set up to allow the main test
files to be buildable w/o the current rpctest tag. We do this so that
those of us that use extensions which will compile live files like
vim-go can once again fix compile errors as we go in our editors.

In order to do this, we now make an external `testsCases` variable, and
have two variants: one that's empty (no build tag), and one that's fully
populated with all our tests (build tag active). As a result, the main
file will now always build regardless of if the build tag is active or
not, but we'll only actually execute tests if the `testCases` variable
has been populated.

As sample run w/ the tag off:
```
=== RUN   TestLightningNetworkDaemon
--- PASS: TestLightningNetworkDaemon (0.00s)
PASS
ok  	github.com/lightningnetwork/lnd/lntest/itest	0.051s
```
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
acd615aca4
lntest: default to btcd as default test harness backend
Otherwise, if we remove the build tags, then there's no default backend,
and compilation will fail.
2020-09-21 21:16:31 +02:00
Olaoluwa Osuntokun
95634186c2
lntest/itest: move harness to new file
This in prep for a bigger move in the next commit.
2020-09-21 21:16:30 +02:00
Joost Jager
6ae05c6bac
Merge pull request #4592 from joostjager/sweep-deadline
cnct+sweep: cpfp-aware anchor sweeping
2020-09-18 20:15:03 +02:00
Joost Jager
29602e88e8
cnct: cpfp-sweep anchors
For unconfirmed commit tx anchors, supply the sweeper with cpfp info and
a confirmation target fee estimate.

The sweeper will try to pay for the parent commit tx as long as the
current fee estimate exceeds the pre-signed commit tx fee rate.
2020-09-17 12:30:41 +02:00
yyforyongyu
d2d71476bd
lntest: init SignerClient and test DeriveSharedKey 2020-09-17 14:52:36 +08:00
Wilmer Paulino
a5c5304c09
Merge pull request #4452 from yyforyongyu/add-connection-timeout
lnrpc+tor: add network connection timeout
2020-09-16 12:28:29 -07:00
Joost Jager
2ebfb64b9b
Merge pull request #4606 from joostjager/cpfp-sweep-prep
cnct+sweep+itest: preparations for cpfp-aware sweeper
2020-09-16 11:48:39 +02:00
Joost Jager
b6ebf3f27d
lntest: use web fee estimator in itests 2020-09-16 08:17:34 +02:00
yyforyongyu
e8d9643f3a
itest: test for connection timeout 2020-09-16 11:50:59 +08:00