fix(deployment): replace hashicorp freeport with smartcontractkit/freeport in nodetestutils#21980
Open
fix(deployment): replace hashicorp freeport with smartcontractkit/freeport in nodetestutils#21980
Conversation
…eport in nodetestutils The move commit fd31642 re-introduced github.com/hashicorp/consul/sdk/freeport into node.go, undoing the repo-wide swap done in 8315b51. The hashicorp library has a TOCTOU race — it briefly binds to check port availability then releases, allowing other CI processes to steal the port before the test binds. The smartcontractkit fork avoids this by holding a TCP listener on an entire port block for the lifetime of the process. Fixes CORE-2375.
Contributor
|
👋 Fletch153, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Contributor
|
✅ No conflicts with other open PRs targeting |
|
Run goimports to fix import ordering in nodetestutils/node.go and run go mod tidy in deployment, integration-tests, and integration-tests/load to remove the now-unused github.com/hashicorp/consul/sdk dependency.
Contributor
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary
Test_UpdateChainConfigs/MCMS_disabledto fail withbind: address already in useat ~7% rategithub.com/hashicorp/consul/sdk/freeport→github.com/smartcontractkit/freeportindeployment/utils/nodetestutils/node.gosmartcontractkit/freeportwas already indeployment/go.modand used innode_test.goin the same package — this file was the only remaining caller of the Consul versionBackground
The Consul freeport library checks port availability by briefly binding then releasing. Another CI process can claim the port in that window (TOCTOU). The smartcontractkit fork eliminates this by holding a TCP listener on an entire port block for the process lifetime, making block ownership exclusive.
This is a regression from fd31642 ("chore: move node test utils from memory package to utils package"), which moved code out of
memory/environment.gobut re-introduced the old hashicorp import instead of carrying over the smartcontractkit one that was already in place after 8315b51 ("chore(repo): swap freeport library").Test plan
deployment/utils/nodetestutilspassTest_UpdateChainConfigs/MCMS_disabledno longer flakes in CIFixes CORE-2375