Skip to content

[Fix][CI] Isolate Hazelcast test port ranges in CI - #11630

Merged
davidzollo merged 1 commit into
apache:devfrom
JeremyXin:engine-server-test-hazelcast-port-isolation
Aug 4, 2026
Merged

davidzollo merged 1 commit into
apache:devfrom
JeremyXin:engine-server-test-hazelcast-port-isolation

Conversation

@JeremyXin

Copy link
Copy Markdown
Contributor

Purpose of this pull request

Fix CI flakes caused by engine-server tests sharing hardcoded Hazelcast port ranges.

Changes

  • Add test utility support for allocating bindable, non-overlapping port ranges.
  • Replace hardcoded Hazelcast 5801 test ports with dynamic range-aware ports.
  • Add coverage for port allocation behavior.

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. I reviewed the full current head 5de1cbc250.

PR solves what problem

  • User pain: engine-server tests use the same fixed Hazelcast port range, so concurrent CI jobs can collide on port binding and fail for infrastructure reasons instead of source logic.
  • Fix approach: allocate a fresh non-overlapping port range per test class/helper and thread that port into the Hazelcast test config builders.
  • One-line summary: this is a focused test-only CI hardening change, and the current head looks good to me.

I. Code change review

1.1 Core logic analysis

Precise change:

  • TestUtils.getAvailablePort(int) now allocates a bindable base port and tracks non-overlapping reserved ranges inside the JVM.
  • AbstractSeaTunnelServerTest, WorkerTagTest, and the REST API tests stop hard-coding 5801 and instead use that helper.
  • TestUtilsTest adds focused coverage for bindable-port and non-overlapping-range behavior.

Before / After:

  • Before: all these tests pinned the same Hazelcast range around 5801, which is fragile under parallel CI.
  • After: each test context gets its own dynamically selected base range.

Key findings:

  • The change is tightly scoped to tests.
  • The runtime path that changed is exactly the port-selection logic for Hazelcast test clusters.
  • I do not see a new source-side blocker here.
  • I did note separately in the queue that the branch is behind_by=2, but I am not treating that as a review blocker because the current head already has a passing Build result on Monday, August 3, 2026.

Logic correctness / runtime path:

Engine-server test bootstrap
  -> getHazelcastConfig()
      -> getHazelcastPort()
      -> TestUtils.getAvailablePort(100)
  -> Hazelcast test cluster binds the selected range
  -> parallel CI jobs stop competing for the same fixed 5801-based range

1.2 Compatibility impact

  • Fully compatible.
  • Test-only change; no API/config/default/protocol/serialization impact.

1.3 Performance / side-effect analysis

  • Small startup overhead from probing candidate ports.
  • Acceptable for tests, and lower operational risk than fixed shared ports.

1.4 Error handling and logs

No blocker found.

II. Code quality assessment

2.1 Code style

The helper extraction is clear and consistent with the existing test utilities.

2.2 Test coverage and stability

The added TestUtilsTest directly covers the new helper behavior and I did not see a flaky-test anti-pattern in the added assertions.

2.3 Documentation updates

No user-facing documentation change is required for this test-only fix.

III. Architecture

3.1 Solution elegance

This is a precise fix rather than a broad refactor.

3.2 Maintainability

Centralizing the port allocation logic in TestUtils makes follow-up test updates easier.

3.3 Extensibility

Future engine-server tests can reuse the same helper instead of introducing more fixed ports.

3.4 Historical compatibility

Compatible.

IV. Problem summary

No blocking issue found on the current head.

V. Merge conclusion

Conclusion: can merge

  1. Blocking items
  • None from Daniel on the current head.
  1. Suggested follow-ups
  • None.

Overall, this is a focused and useful CI-hardening change. Happy to approve.

@davidzollo davidzollo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job
+1

@davidzollo
davidzollo merged commit 696e274 into apache:dev Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants