test: fix port collision in feature_torcontrol.py #37075

Manually merged
ViniciusCestarii merged 1 commit from fix-flaky-feature-torcontrol into master 2026-12-03 09:51:53 +00:00 AGit
ViniciusCestarii commented 2026-12-02 21:01:24 +00:00 (Migrated from github.com)

Closes #37067

feature_torcontrol.py makes 11 next_port() calls starting at p2p_port(2), so the last one uses p2p_port(12), which is node0's P2P port in the test with the next portseed.

Start at p2p_port(1) instead and tighten the off-by-one assert in p2p_port so this fails deterministically.

Closes #37067 `feature_torcontrol.py` makes 11 `next_port()` calls starting at `p2p_port(2)`, so the last one uses `p2p_port(12)`, which is node0's P2P port in the test with the next portseed. Start at `p2p_port(1)` instead and tighten the off-by-one assert in `p2p_port` so this fails deterministically.
DrahtBot commented 2026-12-02 21:01:37 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK maflcko, hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/37075 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/37075.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/37075#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [maflcko](https://github.com/bitcoin/bitcoin/pull/37075#issuecomment-7370339240), [hebasto](https://github.com/bitcoin/bitcoin/pull/37075#pullrequestreview-6166596975) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No findings were published from this review.

Review coverage was incomplete.


Reviewed: 9b28baef9591 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:e1a29e5e677c47d383756f0fcf8f3760725c91d1104dd3ccb2f333b6217eba26:47880f5569fd2047d249266f337c4f2a509adf7d96c3ccb1c7644c2c2a650bff --> <!-- ralph-base:8e5a5a25dad4744219c579589231feff3f0b6d47 --> <!-- ralph-head:9b28baef9591bc3f35a30028402d586ef5ca85f6 --> <!-- ralph-case:0537ebdcffa6688e6e0003b566c96912a21f0360871cf4268456286dcf523313 --> No findings were published from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`9b28baef9591`](<https://git.fish.foo/bitcoin/bitcoin/commit/9b28baef9591bc3f35a30028402d586ef5ca85f6>) · [Review report](<https://review.fish.foo/report/37075-9b28baef9591bc3f35a30028402d586ef5ca85f6-3454-1.html>) · [Previous reports](<https://review.fish.foo/traces/37075/>) [permalink](<https://review.fish.foo/report/37075-9b28baef9591bc3f35a30028402d586ef5ca85f6-3454-1.html>)
maflcko commented 2026-12-03 06:52:47 +00:00 (Migrated from github.com)

Ah thx. I wondered why the assert didn't hit

lgtm ACK 9b28baef95

Ah thx. I wondered why the assert didn't hit lgtm ACK 9b28baef9591bc3f35a30028402d586ef5ca85f6
hebasto (Migrated from github.com) approved these changes 2026-12-03 09:03:45 +00:00
hebasto (Migrated from github.com) left a comment

ACK 9b28baef95, I have reviewed the code and it looks OK.

ACK 9b28baef9591bc3f35a30028402d586ef5ca85f6, I have reviewed the code and it looks OK.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!37075
No description provided.