bitflicker64 opened a new pull request, #3463:
URL: https://github.com/apache/hugegraph/pull/3463
## Purpose of the PR
Small fixes in the `hugegraph-cluster-test` minicluster harness, found while
scanning the module. Test code only; no production code changes.
- `ClusterConfig.getPDRestAddrs` returned each PD's raft address instead of
its REST address. It is exposed through `BaseEnv` but nothing calls it yet, so
a test that starts using it would talk to the raft port.
- `AbstractNodeWrapper.deleteDir` caught the first delete failure, slept one
second and returned without trying again or logging, so a node directory still
held by a stopping process was left behind silently.
## Main Changes
- `ClusterConfig.getPDRestAddrs`: return `127.0.0.1:<rest port>`, built the
same way as `getStoreRestAddrs` and `getServerRestAddrs`. `PDConfig`'s rest
port is the one written to `server.port` in the PD template.
- `AbstractNodeWrapper.deleteDir`: retry the delete once after the sleep,
and log a warning with the path if it still fails. It still does not throw on
an `IOException`, as before.
- `EnvUtil.getAvailablePort`: open the probe `ServerSocket` in
try-with-resources.
- `AbstractConfig.setProperty`: replace the `containsKey`/`replace`/`put`
branch with `put` (same result on a `HashMap`).
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [x] Already covered by existing tests, such as *(please modify tests
here)*.
- [ ] Need tests and can be verified as follows:
- Ran on Linux x86_64, OpenJDK 17.0.20.1, Maven 3.8.7, 2026-11-07, at
`45e7ce7d5`, which has the same tree as this PR's head (only the commit message
was reworded).
`mvn -ntp -B test -pl
hugegraph-cluster-test/hugegraph-clustertest-minicluster -am
-Deditorconfig.skip=true -Dmaven.javadoc.skip=true`
Result: BUILD SUCCESS, 9 tests, 0 failures (`AbstractNodeWrapperTest`
5, including the `deleteDir` paths in `stop()`, `GremlinServerConfigTest` 3,
`EnvUtilTest` 1).
`mvn -ntp -B -q test-compile -pl
hugegraph-cluster-test/hugegraph-clustertest-test -am -Deditorconfig.skip=true
-Dmaven.javadoc.skip=true` exits 0.
- The cluster suites (`SimpleClusterSuiteTest`, `MultiClusterSuiteTest`)
need a packaged distribution and were not run here; this PR does not change
what they call except `deleteDir`, whose success path is unchanged.
- `-Deditorconfig.skip=true` is there because master fails the
editorconfig check on `helm/hugegraph/docs/rag.md` (missing final newline), a
file this PR does not touch.
## Does this PR potentially affect the following parts?
- [ ] Dependencies ([add/update
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
info &
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
- [x] Nope
## Documentation Status
- [ ] `Doc - TODO`: required documentation is pending; complete it before
merging.
- [ ] `Doc - Done`: documentation is included here or linked below.
- [x] `Doc - No Need`: no user-visible documentation is affected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]