From d3d3b393112070be53fa5fb9d3a882f01c4a6d43 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Feb 2026 16:06:20 +1030 Subject: [PATCH 1/8] CI: Speed up 'min-btc-support' by compiling clang with -O3. It's timing out after 2 hours sometimes: this now make it finish in 53 minutes. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72a9fdee61f6..6f9d3297c402 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -132,6 +132,7 @@ jobs: - CFG: compile-clang VALGRIND: 1 COMPILER: clang + COPTFLAGS_VAR: COPTFLAGS="-O3" DEBUG_BUILD: --enable-debugbuild - CFG: compile-clang-sanitizers COMPILER: clang From 2c120775d209499b03235d9dad4b5b921b7e862d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Feb 2026 16:06:20 +1030 Subject: [PATCH 2/8] CI: add more output to apt-get commands, to try to determine source of random delays. Sometimes this times out after 30 minutes. Signed-off-by: Rusty Russell --- .github/scripts/setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index a719c52086c4..715a61daa270 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -4,9 +4,14 @@ export DEBIAN_FRONTEND=noninteractive export RUST_VERSION=stable sudo useradd -ms /bin/bash tester -sudo apt-get update -qq - -sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \ +sudo apt-get update + +# Sometimes this command stalls, so I added debug flags. +sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ + -o Debug::pkgProblemResolver=yes \ + -o Debug::Acquire::http=true \ + -o Debug::Acquire::https=true \ + -o Debug::Acquire::gpgv=true \ autoconf \ automake \ binfmt-support \ From 03dff2a475d5cbe5b1db930ef1e4158e01c45d38 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Feb 2026 16:06:20 +1030 Subject: [PATCH 3/8] CI: cache the apt packages, protoc and bitcoind/elements downloads. Usually downloading and installing takes 90 seconds. But sometimes it takes an hour! Use caching for this, to keep it consistent. Signed-off-by: Rusty Russell --- .github/scripts/install-bitcoind.sh | 16 +++++++- .github/scripts/setup.sh | 24 ++++++++---- .github/workflows/ci.yaml | 60 +++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 10 deletions(-) diff --git a/.github/scripts/install-bitcoind.sh b/.github/scripts/install-bitcoind.sh index 842c6ccd92a3..edf73474ebc6 100755 --- a/.github/scripts/install-bitcoind.sh +++ b/.github/scripts/install-bitcoind.sh @@ -1,4 +1,6 @@ #!/bin/sh +# If an argument is specified, that dir is checked before downloading, +# and updated after successful install. set -e @@ -18,13 +20,23 @@ cd /tmp/ # testing against `bitcoind` but still believe that we ran against # `elementsd`. if [ "$TEST_NETWORK" = "liquid-regtest" ]; then - wget "https://github.com/ElementsProject/elements/releases/download/elements-${ELEMENTS_VERSION}/${EFILENAME}" + if [ -f "$1/${EFILENAME}" ]; then + cp "$1/${EFILENAME}" . + else + wget "https://github.com/ElementsProject/elements/releases/download/elements-${ELEMENTS_VERSION}/${EFILENAME}" + fi tar -xf "${EFILENAME}" + [ "$1" = "" ] || cp "${EFILENAME}" "$1"/ sudo mv "${EDIRNAME}"/bin/* "/usr/local/bin" rm -rf "${EFILENAME}" "${EDIRNAME}" else - wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${FILENAME}" + if [ -f "$1/${FILENAME}" ]; then + cp "$1/${FILENAME}" . + else + wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${FILENAME}" + fi tar -xf "${FILENAME}" + [ "$1" = "" ] || cp "${FILENAME}" "$1"/ sudo mv "${DIRNAME}"/bin/* "/usr/local/bin" rm -rf "${FILENAME}" "${DIRNAME}" fi diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 715a61daa270..1f5d7ce9e15b 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -4,14 +4,14 @@ export DEBIAN_FRONTEND=noninteractive export RUST_VERSION=stable sudo useradd -ms /bin/bash tester +sudo mkdir -p /var/cache/apt/archives +mkdir -p ~/ci-cache/apt/ +sudo cp -a ~/ci-cache/apt/. /var/cache/apt/archives/ 2>/dev/null || true + sudo apt-get update -# Sometimes this command stalls, so I added debug flags. sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ - -o Debug::pkgProblemResolver=yes \ - -o Debug::Acquire::http=true \ - -o Debug::Acquire::https=true \ - -o Debug::Acquire::gpgv=true \ + -o APT::Keep-Downloaded-Packages=true \ autoconf \ automake \ binfmt-support \ @@ -69,7 +69,7 @@ sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester sudo chmod 0440 /etc/sudoers.d/tester -"$(dirname "$0")"/install-bitcoind.sh +"$(dirname "$0")"/install-bitcoind.sh ~/ci-cache/ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ -y --default-toolchain ${RUST_VERSION} @@ -97,8 +97,14 @@ uv tool install poetry PROTOC_VERSION=29.4 PB_REL="https://github.com/protocolbuffers/protobuf/releases" -curl -LO $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -sudo unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/ +PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-x86_64.zip +if [ ! -f ~/ci-cache/$PROTOC_ZIP ]; then + curl -LO $PB_REL/download/v${PROTOC_VERSION}/$PROTOC_ZIP + # Check it before we commit it to the cache! + unzip -t $PROTOC_ZIP + cp $PROTOC_ZIP ~/ci-cache/ +fi +sudo unzip ~/ci-cache/$PROTOC_ZIP -d /usr/local/ sudo chmod a+x /usr/local/bin/protoc export PROTOC=/usr/local/bin/protoc export PATH=$PATH:/usr/local/bin @@ -115,3 +121,5 @@ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap # Add ourselves to the wireshark group (still need "sg wireshark..." for it to take effect) sudo usermod -aG wireshark "$(id -nu)" +# Copy archives back for caching +cp /var/cache/apt/archives/*.deb ~/ci-cache/apt/ || true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6f9d3297c402..fe1394b3d578 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,6 +81,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -153,6 +158,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -203,6 +213,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -263,6 +278,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -308,6 +328,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -356,6 +381,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -442,6 +472,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -536,6 +571,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -611,6 +651,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies run: | bash -x .github/scripts/setup.sh @@ -673,6 +718,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} @@ -730,6 +780,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies run: | bash -x .github/scripts/setup.sh @@ -791,6 +846,11 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 + - uses: actions/cache@v4 + with: + path: ~/ci-cache + key: apt-${{ runner.os }} + - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} From 71f55531e8b89ef53ac804546cc7d70c292145f5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Feb 2026 16:06:20 +1030 Subject: [PATCH 4/8] CI: Don't manually install bitcoind again. .github/scripts/setup.sh does this already, *and* it uses the cache now. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe1394b3d578..cf458b468f6a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -660,9 +660,6 @@ jobs: run: | bash -x .github/scripts/setup.sh - - name: Install bitcoind - run: .github/scripts/install-bitcoind.sh - - name: Download build uses: actions/download-artifact@v4 with: @@ -788,10 +785,7 @@ jobs: - name: Install dependencies run: | bash -x .github/scripts/setup.sh - - name: Install bitcoind - env: - TEST_NETWORK: regtest - run: .github/scripts/install-bitcoind.sh + - name: Download build uses: actions/download-artifact@v4 with: From 43231d827d6124545ef73595d1e1185157822697 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 26 Feb 2026 16:06:20 +1030 Subject: [PATCH 5/8] CI: Remove setup useradd line, use eatmydata I noticed this line causing a delay; ChatGPT thinks NSS name lookup. I've removed the useradd line altogether. I also install eatmydata first, to try to speed the other installs. This drops the install step from 1m45 to about 30 seconds. Signed-off-by: Rusty Russell --- .github/scripts/setup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index 1f5d7ce9e15b..291c4c074c0f 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -3,14 +3,18 @@ set -e export DEBIAN_FRONTEND=noninteractive export RUST_VERSION=stable -sudo useradd -ms /bin/bash tester sudo mkdir -p /var/cache/apt/archives mkdir -p ~/ci-cache/apt/ sudo cp -a ~/ci-cache/apt/. /var/cache/apt/archives/ 2>/dev/null || true sudo apt-get update +# Install eatmydata, then use it for the rest. sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ + -o APT::Keep-Downloaded-Packages=true \ + eatmydata + +sudo eatmydata apt-get install --no-install-recommends --allow-unauthenticated -yy \ -o APT::Keep-Downloaded-Packages=true \ autoconf \ automake \ @@ -19,7 +23,6 @@ sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ clang \ cppcheck \ docbook-xml \ - eatmydata \ gcc-aarch64-linux-gnu \ gcc-arm-linux-gnueabihf \ gcc-arm-none-eabi \ From 77d11cba6500fcc378be0854530d569933586033 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 27 Feb 2026 11:15:04 +1030 Subject: [PATCH 6/8] CI: shorten job names. On the GH action view I can only see "Compile CLN compile-c" which is not enough! Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf458b468f6a..9f384eafc8dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -110,7 +110,7 @@ jobs: if-no-files-found: ignore compile: - name: Compile CLN ${{ matrix.cfg }} + name: Build ${{ matrix.cfg }} runs-on: ubuntu-24.04 timeout-minutes: 30 needs: From 06803ecb5feb2670482e6fd7603144600f245b13 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 28 Feb 2026 10:15:25 +1030 Subject: [PATCH 7/8] pytest: don't invoke the pcap test every session. Only do it when the tcp_capture fixture is invoked, which is only for one test. Signed-off-by: Rusty Russell --- tests/fixtures.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index 7ff7e26d4408..186d8723758b 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -119,12 +119,6 @@ def have_binary(name): return False -@pytest.fixture(scope="session") -def have_pcap_tools(): - if not dumpcap_usable(): - pytest.skip("dumpcap/tshark not available or insufficient privileges") - - class TcpCapture: def __init__(self, tmpdir): self.tmpdir = Path(tmpdir) @@ -179,7 +173,7 @@ def assert_constant_payload(self): @pytest.fixture -def tcp_capture(have_pcap_tools, tmp_path): +def tcp_capture(tmp_path): # You will need permissions. Most distributions have a group which has # permissions to use dumpcap: # $ ls -l /usr/bin/dumpcap @@ -187,6 +181,9 @@ def tcp_capture(have_pcap_tools, tmp_path): # $ getcap /usr/bin/dumpcap # /usr/bin/dumpcap cap_net_admin,cap_net_raw=eip # So you just need to be in the wireshark group. + if not dumpcap_usable(): + pytest.skip("dumpcap/tshark not available or insufficient privileges") + cap = TcpCapture(tmp_path) yield cap cap.stop() From 924cd1b27dc0f201b1681b3c4186ac5f62a7b0b9 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 28 Feb 2026 17:21:00 +1030 Subject: [PATCH 8/8] CI: Disable flakiness tracking. 287abfbd901616a8c81a02ce366158b4f4630ddf "ci: Add a simple plugin to report test results to our falkiness tracker" slowed our integration tests to a crawl: out 6-way gcc integration tests should have taken 20 minutes, but were taking 1hr 24 minutes, and some runs were timing out altogether. I cannot reach the server, seems it is down. But tracking flakiness is rarely useful, so I am disabling this. Signed-off-by: Rusty Russell --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9f384eafc8dd..9e610d9161cf 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,8 @@ env: # Reduce size, helps upload-artifact work more reliably RUST_PROFILE: small SLOW_MACHINE: 1 - CI_SERVER_URL: "http://35.239.136.52:3170" + # This is for the pytest-trackflaky: + # CI_SERVER_URL: "http://35.239.136.52:3170" PYTEST_OPTS_BASE: "-vvv --junit-xml=report.xml --timeout=1800 --durations=10" TEST_LOG_IGNORE_ERRORS: "1" SCCACHE_GHA_ENABLED: "true"