CI: use nproc + 1 for pytest parallelism..
What changed, and why it matters
This commit only changes how many parallel test jobs run in the project's automated continuous integration (CI) system. It replaces hard-coded numbers like 4 or 2 with a dynamic value based on the number of available CPU cores. There is no change to the Core Lightning node software itself, its network behavior, wallet handling, or any user-facing feature. It is purely an infrastructure speed-up.
No security action needed. This is a normal CI optimization. Reviewers may optionally verify that the increased parallelism does not cause resource contention or flaky tests, but that is a reliability concern, not a security one.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies .github/workflows/ci.yaml. It removes the PYTEST_PAR environment variable and changes pytest -n ${PYTEST_PAR} invocations to pytest -n $(($(nproc) + 1)). It also adds -j $(nproc) to one make check-source invocation and changes one make -j $(nproc) to -j $(($(nproc) + 1)). These are build/test throughput tuning changes in GitHub Actions. No application code, cryptographic operations, protocol handling, or privilege boundaries are affected.
Changed components
.github/workflows/ci.yamlInspect captured patch +7 / −13
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index b9a93a23..f566806a 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -93,7 +93,7 @@ jobs:
VALGRIND: 0
PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }}
run: |
- uv run make check-source BASE_REF="origin/${{ github.base_ref }}"
+ uv run make -j $(nproc) check-source BASE_REF="origin/${{ github.base_ref }}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -312,7 +312,6 @@ jobs:
- name: Test
env:
SLOW_MACHINE: 1
- PYTEST_PAR: 4
TEST_DEBUG: 1
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
@@ -323,7 +322,7 @@ jobs:
run: |
env
cat config.vars
- sg wireshark "uv run eatmydata pytest tests/test_downgrade.py -n ${PYTEST_PAR} ${PYTEST_OPTS}"
+ sg wireshark "uv run eatmydata pytest tests/test_downgrade.py -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -430,7 +429,6 @@ jobs:
COMPAT: 1
CFG: ${{ matrix.CFG }}
SLOW_MACHINE: 1
- PYTEST_PAR: 4
TEST_DEBUG: 1
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
@@ -438,7 +436,7 @@ jobs:
run: |
env
cat config.vars
- VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}"
+ VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -524,9 +522,8 @@ jobs:
env:
SLOW_MACHINE: 1
TEST_DEBUG: 1
- PYTEST_PAR: 2
run: |
- VALGRIND=1 sg wireshark "uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}"
+ VALGRIND=1 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -614,10 +611,8 @@ jobs:
run: tar -xvjf cln-compile-clang-sanitizers.tar.bz2
- name: Test
- env:
- PYTEST_PAR: 2
run: |
- sg wireshark "uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}"
+ sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} ${{ matrix.PYTEST_OPTS }}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -667,7 +662,7 @@ jobs:
tar -xaf cln-compile-gcc.tar.bz2
- name: Test
run: |
- uv run eatmydata make -j $(nproc) check-doc-examples
+ uv run eatmydata make -j $(($(nproc) + 1)) check-doc-examples
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
@@ -740,7 +735,6 @@ jobs:
COMPAT: 1
CFG: ${{ matrix.CFG }}
SLOW_MACHINE: 1
- PYTEST_PAR: 4
TEST_DEBUG: 1
TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }}
TEST_NETWORK: ${{ matrix.TEST_NETWORK }}
@@ -748,7 +742,7 @@ jobs:
run: |
env
cat config.vars
- VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS}"
+ VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.