Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2c27df6
itest: print num of blocks for debugging
yyforyongyu Oct 25, 2024
88bd0cb
itest: shuffle test cases to even out blocks mined in tranches
yyforyongyu Oct 24, 2024
ef16783
workflows: pass action ID as the shuffle seed
yyforyongyu Nov 7, 2024
3eda87f
itest: remove direct reference to stanby nodes
yyforyongyu Oct 26, 2024
de8f14b
itest: remove the use of standby nodes
yyforyongyu Nov 20, 2024
11c9dd5
itest: remove unused method `setupFourHopNetwork`
yyforyongyu Nov 20, 2024
00772ae
itest+lntest: remove standby nodes
yyforyongyu Nov 20, 2024
72f3f41
itest: remove unnecessary channel close and node shutdown
yyforyongyu Oct 29, 2024
f64b2ce
lntest: make sure node is properly shut down
yyforyongyu Nov 2, 2024
010a4f1
lntest: add human-readble names and check num of nodes
yyforyongyu Nov 20, 2024
e7310ff
itest: fix `testOpenChannelUpdateFeePolicy`
yyforyongyu Oct 29, 2024
2a9b7ec
itest: fix flake in `testSendDirectPayment`
yyforyongyu Nov 20, 2024
3a45492
itest: fix spawning temp miner
yyforyongyu Oct 29, 2024
762e59d
itest: fix flake for neutrino backend
yyforyongyu Oct 30, 2024
9f764c2
itest: flatten PSBT funding test cases
yyforyongyu Oct 30, 2024
782edde
itest: fix and document flake in sweeping tests
yyforyongyu Oct 30, 2024
c071626
itest: remove loop in `wsTestCaseBiDirectionalSubscription`
yyforyongyu Oct 30, 2024
66b3501
itest: fix flake in `testRevokedCloseRetributionZeroValueRemoteOutput`
yyforyongyu Nov 2, 2024
8b8f0c4
itest: fix flake in `testSwitchOfflineDelivery`
yyforyongyu Nov 3, 2024
4eea207
itest+routing: fix flake in `runFeeEstimationTestCase`
yyforyongyu Nov 3, 2024
fee6b70
itest: use `ht.CreateSimpleNetwork` whenever applicable
yyforyongyu Nov 3, 2024
8f3100c
itest: put mpp tests in one file
yyforyongyu Nov 4, 2024
7ceb9a4
lntest+itest: remove `AssertNumActiveEdges`
yyforyongyu Nov 8, 2024
7c3564e
itest: fix flake in runPsbtChanFundingWithNodes
yyforyongyu Nov 10, 2024
23edca8
itest: fix flake in `testPrivateUpdateAlias`
yyforyongyu Nov 16, 2024
4e85d86
itest: fix flake in `update_pending_open_channels`
yyforyongyu Nov 16, 2024
f912f40
lntest: increase `rpcmaxwebsockets` for `btcd`
yyforyongyu Nov 20, 2024
fb59669
itest: document details about MPP-related tests
yyforyongyu Nov 21, 2024
cfb5713
itest+lntest: fix flake in MPP-related tests
yyforyongyu Nov 21, 2024
39104c5
lntest: fix flakeness in `openChannelsForNodes`
yyforyongyu Nov 22, 2024
7e80b77
itest: document a rare flake found in `macOS`
yyforyongyu Dec 4, 2024
1950d89
itest: document a flake found in `SendToRoute`
yyforyongyu Dec 4, 2024
cca2364
itest: optimize blocks mined in `testGarbageCollectLinkNodes`
yyforyongyu Nov 8, 2024
5663edf
itest: break remote signer into independent cases
yyforyongyu Nov 8, 2024
b1cb819
itest: break down channel restore commit types cases
yyforyongyu Nov 8, 2024
a76ff79
itest: break down utxo selection funding tests
yyforyongyu Nov 8, 2024
04a1503
itest: break all multihop test cases
yyforyongyu Nov 8, 2024
21c5d36
itest: break down scid alias channel update tests
yyforyongyu Nov 8, 2024
3319d0d
itest: break down open channel fee policy
yyforyongyu Nov 8, 2024
7b1427a
itest: break down payment failed tests
yyforyongyu Nov 8, 2024
31aada6
itest: break down channel backup restore tests
yyforyongyu Nov 8, 2024
c58fa01
itest: break down wallet import account tests
yyforyongyu Nov 8, 2024
c029f0a
itest: break down basic funding flow tests
yyforyongyu Nov 9, 2024
efae8ea
itest: break down single hop send to route
yyforyongyu Nov 9, 2024
37b8210
itest: break down taproot tests
yyforyongyu Nov 9, 2024
c7b8379
itest: break down channel fundmax tests
yyforyongyu Nov 9, 2024
6f2e7fe
itest: breakdown `testSendDirectPayment`
yyforyongyu Dec 5, 2024
e79ad6e
itest: further reduce block mined in tests
yyforyongyu Nov 9, 2024
efe81f2
itest: track and skip flaky tests for windows
yyforyongyu Nov 7, 2024
c97c31a
lntest: increase node start timeout and payment benchmark timeout
yyforyongyu Nov 9, 2024
77b2fa0
lntest: make sure policies are populated in `AssertChannelInGraph`
yyforyongyu Nov 21, 2024
691a626
workflows: use `btcd` for macOS
yyforyongyu Nov 9, 2024
5236c05
itest+lntest: add new method `FundNumCoins`
yyforyongyu Nov 25, 2024
becbdce
lntest: limit the num of blocks mined in each test
yyforyongyu Nov 25, 2024
686a7dd
docs: update release notes
yyforyongyu Nov 26, 2024
c536bc2
itest: add a prefix before appending a subtest case
yyforyongyu Dec 3, 2024
33b07be
itest: even out num of tests per tranche
yyforyongyu Dec 4, 2024
d7f8fa6
lntest: increase port timeout
yyforyongyu Dec 4, 2024
73574d9
lntest: add timeouts for windows
yyforyongyu Dec 4, 2024
31b6696
lntest: properly handle shutdown error
yyforyongyu Dec 5, 2024
1dec926
workflows: increase num of tranches to 16
yyforyongyu Dec 5, 2024
7ab4081
lntest: make sure chain backend is synced to miner
yyforyongyu Dec 7, 2024
76eeae3
itest: document and fix wallet UTXO flake
yyforyongyu Dec 7, 2024
2913f6e
itest: fix flake in `testCoopCloseWithExternalDeliveryImpl`
yyforyongyu Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 84 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ defaults:
env:
BITCOIN_VERSION: "28"

TRANCHES: 8
# TRANCHES defines the number of tranches used in the itests.
TRANCHES: 16

# SMALL_TRANCHES defines the number of tranches used in the less stable itest
# builds
#
# TODO(yy): remove this value and use TRANCHES.
SMALL_TRANCHES: 8

# If you change this please also update GO_VERSION in Makefile (then run
# `make lint` to see where else it needs to be updated as well).
Expand Down Expand Up @@ -262,10 +269,10 @@ jobs:


########################
# run ubuntu integration tests
# run integration tests with TRANCHES
########################
ubuntu-integration-test:
name: run ubuntu itests
basic-integration-test:
name: basic itests
runs-on: ubuntu-latest
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
strategy:
Expand All @@ -279,18 +286,6 @@ jobs:
args: backend=bitcoind cover=1
- name: bitcoind-notxindex
args: backend="bitcoind notxindex"
- name: bitcoind-rpcpolling
args: backend="bitcoind rpcpolling" cover=1
- name: bitcoind-etcd
args: backend=bitcoind dbbackend=etcd
- name: bitcoind-postgres
args: backend=bitcoind dbbackend=postgres
- name: bitcoind-sqlite
args: backend=bitcoind dbbackend=sqlite
- name: bitcoind-postgres-nativesql
args: backend=bitcoind dbbackend=postgres nativesql=true
- name: bitcoind-sqlite-nativesql
args: backend=bitcoind dbbackend=sqlite nativesql=true
- name: neutrino
args: backend=neutrino cover=1
steps:
Expand All @@ -316,7 +311,7 @@ jobs:
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION

- name: run ${{ matrix.name }}
run: make itest-parallel tranches=${{ env.TRANCHES }} ${{ matrix.args }}
run: make itest-parallel tranches=${{ env.TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}

- name: Send coverage
if: ${{ contains(matrix.args, 'cover=1') }}
Expand All @@ -339,12 +334,79 @@ jobs:
path: logs-itest-${{ matrix.name }}.zip
retention-days: 5

########################
# run integration tests with SMALL_TRANCHES
########################
integration-test:
name: itests
runs-on: ubuntu-latest
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
include:
- name: bitcoind-rpcpolling
args: backend="bitcoind rpcpolling"
- name: bitcoind-etcd
args: backend=bitcoind dbbackend=etcd
- name: bitcoind-sqlite
args: backend=bitcoind dbbackend=sqlite
- name: bitcoind-sqlite-nativesql
args: backend=bitcoind dbbackend=sqlite nativesql=true
- name: bitcoind-postgres
args: backend=bitcoind dbbackend=postgres
- name: bitcoind-postgres-nativesql
args: backend=bitcoind dbbackend=postgres nativesql=true
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase

- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: integration-test

- name: install bitcoind
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION

- name: run ${{ matrix.name }}
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} ${{ matrix.args }} shuffleseed=${{ github.run_id }}${{ strategy.job-index }}

- name: Send coverage
if: ${{ contains(matrix.args, 'cover=1') }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.txt
flag-name: 'itest-${{ matrix.name }}'
parallel: true

- name: Zip log files on failure
if: ${{ failure() }}
timeout-minutes: 5 # timeout after 5 minute
run: 7z a logs-itest-${{ matrix.name }}.zip itest/**/*.log

- name: Upload log files on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: logs-itest-${{ matrix.name }}
path: logs-itest-${{ matrix.name }}.zip
retention-days: 5


########################
# run windows integration test
########################
windows-integration-test:
name: run windows itest
name: windows itest
runs-on: windows-latest
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
steps:
Expand All @@ -364,7 +426,7 @@ jobs:
key-prefix: integration-test

- name: run itest
run: make itest-parallel tranches=${{ env.TRANCHES }} windows=1
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} windows=1 shuffleseed=${{ github.run_id }}

- name: kill any remaining lnd processes
if: ${{ failure() }}
Expand All @@ -388,7 +450,7 @@ jobs:
# run macOS integration test
########################
macos-integration-test:
name: run macOS itest
name: macOS itest
runs-on: macos-14
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
steps:
Expand All @@ -407,14 +469,8 @@ jobs:
go-version: '${{ env.GO_VERSION }}'
key-prefix: integration-test

- name: install bitcoind
run: |
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}.0/bitcoin-${BITCOIN_VERSION}.0-arm64-apple-darwin.tar.gz
tar zxvf bitcoin-${BITCOIN_VERSION}.0-arm64-apple-darwin.tar.gz
mv bitcoin-${BITCOIN_VERSION}.0 /tmp/bitcoin

- name: run itest
run: PATH=$PATH:/tmp/bitcoin/bin make itest-parallel tranches=${{ env.TRANCHES }} backend=bitcoind
run: make itest-parallel tranches=${{ env.SMALL_TRANCHES }} shuffleseed=${{ github.run_id }}

- name: Zip log files on failure
if: ${{ failure() }}
Expand Down Expand Up @@ -473,7 +529,7 @@ jobs:
# Notify about the completion of all coverage collecting jobs.
finish:
if: ${{ always() }}
needs: [unit-test, ubuntu-integration-test]
needs: [unit-test, basic-integration-test]
runs-on: ubuntu-latest
steps:
- uses: ziggie1984/actions-goveralls@c440f43938a4032b627d2b03d61d4ae1a2ba2b5c
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ clean-itest-logs:
itest-only: clean-itest-logs db-instance
@$(call print, "Running integration tests with ${backend} backend.")
date
EXEC_SUFFIX=$(EXEC_SUFFIX) scripts/itest_part.sh 0 1 $(TEST_FLAGS) $(ITEST_FLAGS) -test.v
EXEC_SUFFIX=$(EXEC_SUFFIX) scripts/itest_part.sh 0 1 $(SHUFFLE_SEED) $(TEST_FLAGS) $(ITEST_FLAGS) -test.v
$(COLLECT_ITEST_COVERAGE)

#? itest: Build and run integration tests
Expand All @@ -233,7 +233,7 @@ itest-race: build-itest-race itest-only
itest-parallel: clean-itest-logs build-itest db-instance
@$(call print, "Running tests")
date
EXEC_SUFFIX=$(EXEC_SUFFIX) scripts/itest_parallel.sh $(ITEST_PARALLELISM) $(NUM_ITEST_TRANCHES) $(TEST_FLAGS) $(ITEST_FLAGS)
EXEC_SUFFIX=$(EXEC_SUFFIX) scripts/itest_parallel.sh $(ITEST_PARALLELISM) $(NUM_ITEST_TRANCHES) $(SHUFFLE_SEED) $(TEST_FLAGS) $(ITEST_FLAGS)
$(COLLECT_ITEST_COVERAGE)

#? itest-clean: Kill all running itest processes
Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes/release-notes-0.19.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ The underlying functionality between those two options remain the same.
estimator provided by bitcoind or btcd in regtest and simnet modes instead of
static fee estimator if feeurl is not provided.

* The integration tests CI have been optimized to run faster and all flakes are
now documented and
[fixed](https://github.com/lightningnetwork/lnd/pull/9368).

## Database

* [Migrate the mission control
Expand Down
111 changes: 111 additions & 0 deletions itest/list_exclude_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
//go:build integration

package itest

import (
"fmt"

"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/lntest"
)

// excludedTestsWindows is a list of tests that are flaky on Windows and should
// be excluded from the test suite atm.
//
// TODO(yy): fix these tests and remove them from this list.
var excludedTestsWindows = []string{
"batch channel funding",
"zero conf channel open",
"open channel with unstable utxos",
"funding flow persistence",

// Gives "channel link not found" error.
"zero conf-channel policy update public zero conf",

"listsweeps",
"sweep htlcs",
"sweep cpfp anchor incoming timeout",
"payment succeeded htlc remote swept",
"3rd party anchor spend",

"send payment amp",
"async payments benchmark",
"async bidirectional payments",

"multihop-htlc aggregation leased",
"multihop-htlc aggregation leased zero conf",
"multihop-htlc aggregation anchor",
"multihop-htlc aggregation anchor zero conf",
"multihop-htlc aggregation simple taproot",
"multihop-htlc aggregation simple taproot zero conf",

"channel force closure anchor",
"channel force closure simple taproot",
"channel backup restore force close",
"wipe forwarding packages",

"coop close with htlcs",
"coop close with external delivery",

"forward interceptor restart",
"forward interceptor dedup htlcs",
"invoice HTLC modifier basic",
"lookup htlc resolution",

"remote signer-taproot",
"remote signer-account import",
"remote signer-bump fee",
"remote signer-funding input types",
"remote signer-funding async payments taproot",
"remote signer-funding async payments",
"remote signer-random seed",
"remote signer-verify msg",
"remote signer-channel open",
"remote signer-shared key",
"remote signer-psbt",
"remote signer-sign output raw",

"on chain to blinded",
"query blinded route",

"data loss protection",
}

// filterWindowsFlakyTests filters out the flaky tests that are excluded from
// the test suite on Windows.
func filterWindowsFlakyTests() []*lntest.TestCase {
// filteredTestCases is a substest of allTestCases that excludes the
// above flaky tests.
filteredTestCases := make([]*lntest.TestCase, 0, len(allTestCases))

// Create a set for the excluded test cases for fast lookup.
excludedSet := fn.NewSet(excludedTestsWindows...)

// Remove the tests from the excludedSet if it's found in the list of
// all test cases. This is done to ensure the excluded tests are not
// pointing to a test case that doesn't exist.
for _, tc := range allTestCases {
if excludedSet.Contains(tc.Name) {
excludedSet.Remove(tc.Name)

continue
}

filteredTestCases = append(filteredTestCases, tc)
}

// Exit early if all the excluded tests are found in allTestCases.
if excludedSet.IsEmpty() {
return filteredTestCases
}

// Otherwise, print out the tests that are not found in allTestCases.
errStr := "\nThe following tests are not found, please make sure the " +
"test names are correct in `excludedTestsWindows`.\n"
for _, name := range excludedSet.ToSlice() {
errStr += fmt.Sprintf("Test not found in test suite: %v\n",
name)
}

panic(errStr)
}
Loading