Skip to content

test: decouple MongoDB lease UT from port availability - #28884

Merged
XuPeng-SH merged 1 commit into
mainfrom
codex/issue-28882-port-lease
Sep 15, 2026
Merged

XuPeng-SH merged 1 commit into
mainfrom
codex/issue-28882-port-lease

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #28882

What this PR does / why we need it:

The parent-death test used the full port planner to check whether a flock lease had been released. The allocator acquires the flock first and only then probes the 80 ports, so unrelated host port occupancy could make the test report a lease failure even when the lock was free.

Add an internal lease-only profile that reuses the existing acquisition/release logic without probing ports. The parent-death test now verifies actual lock contention and acquisition on the same lock file. The neighboring cross-process test still verifies that different TMPDIR values share the host-default lease namespace and requires the exact lease-conflict error.

Production port allocation, availability checks, and host-wide locking are unchanged.

Validation (macOS): bash -n optools/mongodb_ci.bash; focused lease tests; each changed test passed -race -count=100; GOWORK=off go test -mod=readonly -timeout 120s ./test/mongodb.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Sep 14, 2026
@mergify mergify Bot added the kind/test-ci label Sep 14, 2026
@XuPeng-SH
XuPeng-SH force-pushed the codex/issue-28882-port-lease branch from f9c67f2 to 43c8c4e Compare September 15, 2026 01:26
@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

CI triage/rebase update for head 43c8c4e87f904e2f85a79a8e316b03ece9e68733:

  • The failed Ubuntu/x86 UT job 104175702889 (run 34903702725) failed in pkg/tests/issues/TestIssue28313EmptyRemoteDispatch after 180s with context deadline exceeded; the log then showed remote-dispatch receiver/stream cleanup errors.
  • This PR changes only the MongoDB port-lease test helper and test. It does not touch MORPC, shuffle, remote dispatch, or the affected issue test, so the failure is not PR-owned.
  • The occurrence belongs to existing open base issue [Bug] dev:distributed join aborts when remote dispatch targets another local pipeline tree #28313 (remote-dispatch/shuffle receiver lifecycle/error propagation). I recorded the new job evidence there and reused that issue rather than creating a duplicate.
  • The branch was pure-rebased onto current main f0f61f0bc6852a67447921733f641c7d32c0c25b and safely updated on the non-default feature ref. bash -n and the existing focused lease checks passed before the rebase.

No speculative production change was added to this test PR; the base fix remains queued under #28313. CI after the rebase is intentionally not awaited.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Rebased the existing feature ref onto latest main at 1d7d425f6c and updated only codex/issue-28882-port-lease (default branch untouched). New head is 3489a6bbef; focused MongoDB normal/race and incremental lint checks remain green. The current CI failures are base fixture/lifecycle failures, not caused by this test-only lease isolation change; no remote CI wait.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GPT-6 medium deep review at exact head 3489a6b\n\nNo concrete correctness or lifecycle findings. The tests establish real lock contention and same-file reacquisition after parent death.\n\nValidation closure remains pending: please attach revision-linked terminal output for each changed test's reported focused race repetitions and the normal ./test/mongodb package run. Exact-head CI is green and selects the package under race mode, but does not establish those additional runs.\n\nCOMMENT only because this PR is self-authored.

@XuPeng-SH
XuPeng-SH merged commit 6753979 into main Sep 15, 2026
34 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/issue-28882-port-lease branch September 15, 2026 14:11
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…28884)

## What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Fixes matrixorigin#28882

## What this PR does / why we need it:

The parent-death test used the full port planner to check whether a
flock lease had been released. The allocator acquires the flock first
and only then probes the 80 ports, so unrelated host port occupancy
could make the test report a lease failure even when the lock was free.

Add an internal lease-only profile that reuses the existing
acquisition/release logic without probing ports. The parent-death test
now verifies actual lock contention and acquisition on the same lock
file. The neighboring cross-process test still verifies that different
TMPDIR values share the host-default lease namespace and requires the
exact lease-conflict error.

Production port allocation, availability checks, and host-wide locking
are unchanged.

Validation (macOS): `bash -n optools/mongodb_ci.bash`; focused lease
tests; each changed test passed `-race -count=100`; `GOWORK=off go test
-mod=readonly -timeout 120s ./test/mongodb`.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
…28884)

## What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Fixes matrixorigin#28882

## What this PR does / why we need it:

The parent-death test used the full port planner to check whether a
flock lease had been released. The allocator acquires the flock first
and only then probes the 80 ports, so unrelated host port occupancy
could make the test report a lease failure even when the lock was free.

Add an internal lease-only profile that reuses the existing
acquisition/release logic without probing ports. The parent-death test
now verifies actual lock contention and acquisition on the same lock
file. The neighboring cross-process test still verifies that different
TMPDIR values share the host-default lease namespace and requires the
exact lease-conflict error.

Production port allocation, availability checks, and host-wide locking
are unchanged.

Validation (macOS): `bash -n optools/mongodb_ci.bash`; focused lease
tests; each changed test passed `-race -count=100`; `GOWORK=off go test
-mod=readonly -timeout 120s ./test/mongodb`.

This branch was previously deployed

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

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MongoDB lease-release UT can fail on unrelated port occupancy

2 participants