Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- Observed in GitHub Actions UT Coverage on Ubuntu/x86: run 34887783834, job 104122721785
- PR head: ec4bf8f
- The test and helper are unchanged from the base commit.
Actual Behavior
TestMongoDBLocalE2EPortPlanReleasesLeaseAfterParentDeath failed with:
port lease remained after parent death: [mongodb-ci] ERROR: MO_MONGODB_LOG_PORT_BASE is not available on this host
The explicit-base allocation path acquires the flock lease first, then probes all 80 ports. It reports already leased if flock acquisition fails, but reports the observed not available error after the lock was acquired and a bind probe failed. Therefore this CI failure does not show that the parent-death lease remained held. The probe does not identify which port was unavailable, so the exact competing socket/process is unknown.
Expected Behavior
The parent-death test should assert the flock-release invariant directly and deterministically, independent of whether arbitrary host ports happen to be available. Port-block availability should remain a separate allocation concern, with actionable diagnostics when a requested block is unavailable.
Steps to Reproduce
- Run
TestMongoDBLocalE2EPortPlanReleasesLeaseAfterParentDeathfrom./test/mongodbin UT Coverage mode. - The test selects an 80-port block, starts a held
port-planprocess using a test-local lease directory, kills its Bash parent, then retries the full port planner for the same block for up to three seconds. - If any port in that block is unavailable during the retries, the test reports that the lease remained, even when the flock itself can be reacquired. This is timing/host-port dependent and may not reproduce on every run.
Additional Information
- The test supplies
MO_MONGODB_PORT_LEASE_DIRundert.TempDir(), so it does not share the default host-wide lease namespace with normal MongoDB E2E runs. port_block_is_availablebinds and closes each socket; it is not the lease oracle and cannot guarantee the block remains free.- The test/helper were introduced in merged PR test: add MongoDB and UUID issue regressions #27516. Preserve the host-wide lease behavior that prevents real concurrent E2E port allocation; fix the test contract rather than weakening or removing that protection.
- Root source:
test/mongodb/mongodb_e2e_local_test.goandoptools/mongodb_ci.bash.
Activity
test: decouple MongoDB lease UT from port availability (#28884)
test: decouple MongoDB lease UT from port availability (matrixorigin#…
test: decouple MongoDB lease UT from port availability (matrixorigin#…