make: Fix repeat-dpc-examples script
What changed, and why it matters
This is a tiny Makefile fix for an internal developer script that repeatedly runs documentation example tests. The change defines a BASE_PORTNUM variable so each test iteration uses a different network port range, preventing port collisions between iterations. There is no security relevance.
No security action needed. Treat as routine build/test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies the repeat-doc-examples Makefile target. Previously, BASE_PORTNUM was referenced in the pytest invocation but never set in the loop, so all iterations likely used the same default port range. The patch adds PORT_OFFSET and BASE_PORTNUM calculations per iteration (BASE_PORTNUM=$((30000 + i * 100))) and logs which base port is used. This is a build/test tooling correctness fix with no product code changes.
Changed components
Makefilerepeat-doc-examples targetInspect captured patch +3 / −1
diff --git a/Makefile b/Makefile
index fa1f69d0..fb1f068d 100644
--- a/Makefile
+++ b/Makefile
@@ -653,8 +653,10 @@ DOC_EXAMPLES_PATH = $(CURDIR)/lightningd:$(CURDIR)/cli:$(CURDIR)/tools:$(PATH)
repeat-doc-examples:
@for i in $$(seq 1 $(n)); do \
+ PORT_OFFSET=$$((i * 100)); \
+ BASE_PORTNUM=$$((30000 + PORT_OFFSET)); \
echo "----------------------------------" >> tests/autogenerate-examples-repeat.log; \
- echo "Iteration $$i" >> tests/autogenerate-examples-repeat.log; \
+ echo "Iteration $$i on Base Port $$BASE_PORTNUM" >> tests/autogenerate-examples-repeat.log; \
echo "----------------------------------" >> tests/autogenerate-examples-repeat.log; \
PATH="$(DOC_EXAMPLES_PATH)" TEST_DEBUG=1 VALGRIND=0 GENERATE_EXAMPLES=1 CLN_NEXT_VERSION=$(CLN_NEXT_VERSION) BASE_PORTNUM=$$BASE_PORTNUM pytest -vvv --timeout=1200 tests/autogenerate-rpc-examples.py; \
git diff >> tests/autogenerate-examples-repeat.log; \
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.