Commit Graph

30 Commits

Author SHA1 Message Date
yyforyongyu
14f45d0722
lntemp+lntest: fix make lint 2022-10-27 01:11:35 +08:00
yyforyongyu
42eab93ba0
lntemp+lntest: use t.Cleanup to register cleanup functions 2022-10-27 01:11:34 +08:00
yyforyongyu
ab62109865
lntemp+lntest: always wait for nodes sync after mining blocks
In this commit, we introduce two mining methods, `MineBlocks` and
`MineBlocksAndAssertNumTxes`, to `HarnessTest`. These methods are
different from the miner's methods as they would 1) mine the blocks
slowly and 2) assert all active nodes have synced. The miner's methods
are kept for future tests such as mining blocks really fast and see the
behavior of `lnd`.
2022-10-27 01:11:34 +08:00
yyforyongyu
78de9dae05
itest: break testMultiHopHtlcClaims into smaller test cases
This commit breaks the large `testMultiHopHtlcClaims` into independent
test cases to take the advantage of parallel testing. The old setup will
put the stress of creating and syncing new blocks into a single core,
which causes a much longer test time and sometimes times out.
2022-10-27 01:11:34 +08:00
yyforyongyu
3b250b294c
rpcserver+lntemp: add more error logs to PendingChannels
This commit adds error logs to `PendingChannels` and changes how we
assert the num of pending force close channels, see the docs for more
info.
2022-10-27 01:11:33 +08:00
yyforyongyu
c3bc4d403c
itest: reduce blocks mined to save sync time 2022-10-27 01:11:33 +08:00
yyforyongyu
6b5f4f407c
itest: refactor testMultiHopLocalForceCloseOnChainHtlcTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
d51f98efc6
itest: refactor testMultiHopReceiverChainClaim 2022-10-27 01:11:32 +08:00
yyforyongyu
5a7c6cea02
lntest+lntemp: refactor testMultiHopHtlcLocalTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
e8dc15dae4
lntemp: add supporting methods for testDataLossProtection 2022-10-27 01:11:31 +08:00
yyforyongyu
8cd5a9b6b1
itest: refactor testChannelBackupRestore 2022-10-27 01:11:31 +08:00
yyforyongyu
2966773018
lntemp: add more assertions and supporting methods 2022-10-27 01:11:31 +08:00
yyforyongyu
8518f3bea9
lntemp: support creating node from a seed 2022-10-27 01:11:31 +08:00
yyforyongyu
f9453cbe97
lntemp: fix context inheritance
This commit changes how the context is created and inherited to better
reflex the relationship of the components. We now have the following
context structure,
```
For ephemeral nodes, the context chain is,
main HarnessTest -> sub HarnessTest -> HarnessNode -> HarnessRPC

For standby nodes, the context chain is,
main HarnessTest -> standby HarnessNode -> HarnessRPC
```
2022-10-27 01:11:31 +08:00
yyforyongyu
352be086a1
lntemp: replace pubkeyStr with NodeID
This commit replaces the keys used in the maps `activeNodes` and
`standbyNodes` from `pubkeyStr` to `NodeID` such that even the node is
not properly started, we can still clean it up during shutdown.
2022-10-27 01:11:31 +08:00
yyforyongyu
1d135c1409
lntemp: expand package to support testExternalFundingChanPoint 2022-10-27 01:11:30 +08:00
yyforyongyu
19981ac9bd
lntemp: expand package to support testBasicChannelFunding
This commit adds more supporting methods to support the test
`testBasicChannelFunding`.
2022-10-27 01:11:30 +08:00
yyforyongyu
b312ae24aa
lntemp: add README 2022-10-14 15:45:25 +08:00
yyforyongyu
353b744039
lntemp+itest: create interface WebFeeService
This commit adds a new interface, `WebFeeService`, so external projects
can create their own mocked fee services.
2022-10-14 15:45:25 +08:00
yyforyongyu
cc69634a2e
lntemp: add more methods to support testUpdateChanStatus 2022-10-14 15:45:24 +08:00
yyforyongyu
645257a55f
lntemp: complete HarnessNode with setup functions
This commit adds more methods in `HarnessNode` and a `SetupHarness` helper
to easily setup a new itest.
2022-10-14 15:45:24 +08:00
yyforyongyu
a3fa4ba10a
lntemp: re-introduce HarnessTest as a test manager
This commit adds a new component, `HarnessTest`, as a test manager, which
is responsible for managing the state change in the itest. It is built
on top of `HarnessNode` and will be handling assertions so that a test
can be created without unnecessary attention to node's unwanted
failures. This commit also adds a minimal set of assertions.
2022-10-14 15:45:24 +08:00
yyforyongyu
89d275169a
lntemp: add nodeManager to manage running nodes
This commit adds a new struct, `nodeManager`, to manage running nodes.
It keeps track of the running nodes, and manages the start and stop of
the nodes with the context of `HarnessTest`.
2022-10-14 15:45:23 +08:00
yyforyongyu
ea1336ae2a
lntemp: add HarnessMiner to manage miner related functions 2022-10-14 15:45:23 +08:00
yyforyongyu
00b143eac8
lntemp: add utils and fee service
This commit adds several helper functions and a fee service. Note that
the fee service is identical to what's inside `lntest`. Once the
migration is done, the old file will be removed.
2022-10-14 15:45:23 +08:00
yyforyongyu
d32539ab86
lntemp: add HarnessNode to manage lnd's process
This commit adds a new struct, `HarnessNode`, to manage the lnd process
used in our itest. This struct is built upon `HarnessRPC`, `State`, and
`NodeWatcher`.
2022-10-14 15:45:23 +08:00
yyforyongyu
cf0e0820d6
lntemp: introduce SyncMap to store type information
This commit replaces the usage of `sync.Map` with the new struct
`SyncMap` to explicitly express the type info used in the map.
2022-10-14 07:25:29 +08:00
yyforyongyu
30ebacb888
lntemp/node: add node topology watcher
This commit adds a new struct, `nodeWatcher`, to keep track of all graph
topology updates of a given node, including updates from channel edges,
policies, and peers.
2022-10-14 07:25:29 +08:00
yyforyongyu
f8dcebb637
lntemp/node: introduce node state
This commit adds a new package `lntemp/node` and inside it a new struct
`State` is added to track the internal node state. This enables us using
the same running nodes accross tests without wrong uncleaned states.
2022-10-14 07:25:29 +08:00
yyforyongyu
d5abecbba9
lntemp/rpc: add new package lntemp/rpc to manage rpc clients
This commit starts the construction of the new package `lntemp`. This
package serves as the scaffolding while we migrate our old itest into
the new one. Once the migration is finished, the package will be put
back to `lntest`.
2022-10-14 07:25:29 +08:00