bitflicker64 opened a new pull request, #3309: URL: https://github.com/apache/hugegraph/pull/3309
## Purpose of the PR - Related to the 1.8.0 release work in #3242. No issue is closed by this PR. Before 1.8.0 we wanted more executable tests module by module, with attention to the parts that changed recently: the Java 17 migration, the new `hugegraph-struct` module, and the RocksDB and JRaft upgrades. Several test classes in the repository also compiled but never ran, because no suite or Surefire include picked them up. This PR only touches test classes and suite registration. There are no production, dependency, configuration, CI or documentation changes. Each module is a separate commit so it can be reviewed on its own.  ## Main Changes | Commit | Lines | What it adds | |---|---|---| | `test(struct)` | +451 | Struct-side `BytesBufferTest`: varint rejection, unsigned limits, length-prefixed bytes, string endings, edge and index id encoding, partition and OLAP id parsing, tagged collections, buffer growth. `EdgeIdTest`: text form, parse errors, binary id generation. | | `test(commons)` | +899 | `TypedOptionTest` (option parsing and checkers), `HugeConfigValidationTest` (URL normalization, input validation), `HostNameVerifierTest` (negative paths after #3307: SAN matching, wildcard scope, IP vs DNS, no CN fallback), rpc `RpcConfigTest` (self URL exclusion, invalid options, provider and consumer config, service cleanup on destroy). | | `test(server)` | +677 | `RocksDBStdSessionsLifecycleTest` (unopened tables, rollback, reopen, lock release after force close and bad options, iterator double close, snapshot path), `RocksDBIteratorPoolTest`, `HstoreTableRoutingTest`. Registers `ConsumersTest`, `MemoryAllocateTest` and `MemoryManageTest`, which existed but never ran. | | `test(pd)` | +692 | `KVOperationTest` (encoding, null checks, truncated input, whitelist decoding), `RaftKVStoreTest` (writes go through raft, leader check, raft failure, state machine replay), `PeerUtilTest`, `ZipUtilsTest` (snapshot checksums, zip-slip entries). Registers `RaftReflectionUtilTest`. | | `test(store)` | +1029 | `Base58EncoderTest`, `KeyUtilTest`, `CRC64Test`, `ZipUtilsPathSafetyTest` (both ZipUtils copies), `SessionOperatorTest` (writes, ranges, iterator release, snapshots), `PartitionMetaCodecTest`, `HgBufferProxyTest`. Registers `HgStoreStateMachineTest`, `FutureClosureTest`, `HgAssertTest` and `HgPairTest`. The `reuseForks=false` setting of the core execution is unchanged. | | `test(cluster)` | +164 | `SimpleClusterGraphTest`: creates schema, vertices and an edge through the server, reads them back by id and by adjacency through the HStore backend, and checks that invalid vertex requests and unknown ids are rejected. | New RocksDB tests use `TemporaryFolder` instead of fixed paths. No new test binds a fixed port. ## Verifying these changes - [ ] Trivial rework / code cleanup without any test coverage. (No Need) - [ ] Already covered by existing tests, such as *(please modify tests here)*. - [x] Need tests and can be verified as follows: - Run locally on JDK 17.0.20 and Maven 3.8.7, on 2026-10-11, at this PR head. Base is `36bc1c64b`. The figures are run/failed/errors/skipped. | Command (from the repository root) | Before | After | |---|---|---| | `mvn test -pl hugegraph-struct` | 110/0/0/0 | 129/0/0/0 | | `mvn test -pl hugegraph-commons/hugegraph-common -Dtest=UnitTestSuite -DskipCommonsTests=false` | 366/2/4/0 | 389/2/4/0 | | `mvn test -pl hugegraph-commons/hugegraph-rpc -Dtest=UnitTestSuite -DskipCommonsTests=false` | 25/0/0/0 | 31/0/0/0 | | `mvn test -pl hugegraph-server/hugegraph-test -P unit-test` | 996/0/0/8 | 1031/0/0/8 | | `mvn test -pl hugegraph-pd/hg-pd-test -P pd-core-test` | 113/0/0/2 | 149/0/0/2 | | `mvn test -pl hugegraph-store/hg-store-test -P store-common-test` | 2/0/0/0 | 14/0/0/0 | | `... -P store-rocksdb-test` | 3/0/0/0 | 19/0/0/0 | | `... -P store-raftcore-test` | 16/0/0/0 | 27/0/0/0 | | `... -P store-client-test` | 67/0/0/0 | 90/0/0/0 | | `... -P store-core-test` | 93 run, 1 failure (see below) | 100/0/0/0 | | `mvn test -pl hugegraph-cluster-test/hugegraph-clustertest-test -P simple-cluster-test` | 6/0/0/0 | 8/0/0/0 | - The 6 common failures and errors happen both before and after this change, and they come from the test host. Two `RestClientTest` HTTPS tests time out reaching an external endpoint, and four `MachineInfoTest` tests find no MAC or IP address on that machine. - The one store-core failure before the change was `HeartbeatShutdownTest`, in a checkout where `hg-store-node` had not been compiled. With a full build it passes. - Every new class was also run on its own at least twice. For each module, one expectation was broken on purpose to confirm that the tests fail. - `mvn editorconfig:check` passes on every touched test module. ## 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. Documentation files in this PR or paired hugegraph-doc PR: ## Known limitations These tests were left out or left unregistered on purpose. - `MemoryConsumerTest` passes on its own but fails inside `UnitTestSuite`. An earlier test terminates the shared `EventHub` executor, and its `clearBackend()` calls then get `RejectedExecutionException`. It is left unregistered and unchanged. - `PDWatchTest` has no assertions and needs a live PD. `PDPulseTest` is marked `@Useless` and waits forever against a live PD without stores. Neither is registered. - The store client tests that need a running cluster are not registered. Seven classes in the `CoreSuiteTest` TODO block pass on their own; they are left for a follow-up. - The cluster harness cannot stop and restart single nodes yet, so this PR has no node-failure scenarios. `multi-cluster-test` was not run locally. Some new tests exposed behaviour that looks wrong in production code. Those tests are not part of this PR; the findings will be reported separately: - In struct `IdUtil`, an id part that ends with a backtick does not survive escaping and unescaping. `SplicingIdGenerator.split(concat("a`", "b"))` returns `["a>b"]`. - In struct `BytesBuffer.readVInt` and `readVLong`, the `leading == 0x80` check compares a signed byte with 128, so it is never true. `wrap({0x80, 1}).readVInt()` returns 1. - `HugeConfig.validateOption` skips the option checker when a value is already of the target Java type. A port of 70000 passed as an `Integer` is accepted. - `RocksDBStdSessions.scan()` opens a native iterator before the scan arguments are checked, and never closes it when the check fails. -- 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]
