Skip to content

fix(deployment): replace hashicorp freeport with smartcontractkit/freeport in nodetestutils#21980

Open
Fletch153 wants to merge 2 commits intodevelopfrom
core-2375-fix
Open

fix(deployment): replace hashicorp freeport with smartcontractkit/freeport in nodetestutils#21980
Fletch153 wants to merge 2 commits intodevelopfrom
core-2375-fix

Conversation

@Fletch153
Copy link
Copy Markdown
Collaborator

@Fletch153 Fletch153 commented Apr 10, 2026

Summary

  • Fixes a TOCTOU port-conflict race in CI that caused Test_UpdateChainConfigs/MCMS_disabled to fail with bind: address already in use at ~7% rate
  • Swaps github.com/hashicorp/consul/sdk/freeportgithub.com/smartcontractkit/freeport in deployment/utils/nodetestutils/node.go
  • smartcontractkit/freeport was already in deployment/go.mod and used in node_test.go in the same package — this file was the only remaining caller of the Consul version

Background

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.go but 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

  • Existing unit tests in deployment/utils/nodetestutils pass
  • Test_UpdateChainConfigs/MCMS_disabled no longer flakes in CI

Fixes CORE-2375

…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.
@github-actions
Copy link
Copy Markdown
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!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 10, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CCIPTokenTransfer_EVM2Sui_ManagedTokenPool_NoRateLimit The test failed during the CCIP token transfer process, but the specific cause of failure is not explicitly stated in the log. Logs ↗︎

View Full Report ↗︎Docs

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.
@Fletch153 Fletch153 requested review from a team as code owners April 10, 2026 22:26
@github-actions
Copy link
Copy Markdown
Contributor

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/deployment/ 1 @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/operations-platform, @smartcontractkit/core
go.mod 2 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 1 @smartcontractkit/core, @smartcontractkit/foundations
integration-tests/go.mod 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations
integration-tests/go.sum 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@cl-sonarqube-production
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant