Skip to content

fix(ci): append the start-server config lines only once - #3371

Merged
imbajin merged 2 commits into
apache:masterfrom
hugegraph:fix/ci-start-server-twice
Oct 17, 2026
Merged

imbajin merged 2 commits into
apache:masterfrom
hugegraph:fix/ci-start-server-twice

Conversation

@bitflicker64

@bitflicker64 bitflicker64 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Purpose of the PR

#3366 made run-api-test.sh start the Server twice on the same configuration: first without authentication for CypherAnonymousApiTest, then with it. start-server.sh appends its config lines on every call, so with hstore the init-store.sh of the second start reads usePD as [true, true]:

Exception in thread "main" java.lang.IllegalArgumentException: Invalid value for key 'usePD': '[true, true]'
	at org.apache.hugegraph.config.HugeConfig.validateOption(HugeConfig.java:157)

With hbase the second start fails the same way on restserver.request_timeout (#2945, run 39047184170, 2026-10-17):

Exception in thread "main" java.lang.IllegalArgumentException: Invalid value for key 'restserver.request_timeout': '[200, 200]'

The CI of #3366 ran neither job (pd_store and compatibility / build-server-backends were skipped): apart from install-backend.sh, which selects both, the planner selects hstore for a hugegraph-dist path only when the path contains pd, store or distributed, and hbase only when the file name contains hbase. No master push since then has touched PD or Store, so #3368 (run 39031115954) and #3369 (run 39032643888) are the first to run the hstore job after the merge, and both fail there. The last master run of the hstore job that finished passed, at 92af2f8 on 2026-10-14.

#3355 makes the same start-server.sh change in its 9e6dc50 (a set_property helper) and adds its own test-start-server.sh, so whichever of the two PRs lands second needs a rebase onto the other.

Main Changes

  • start-server.sh appends each config line only when the file does not already hold it (append_once, a whole-line grep -qxF). This covers usePD=true for hstore, the two hbase timeouts and schema.sync_deletion=true, which are appended the same way. rocksdb is not affected by the doubled schema.sync_deletion line, since no option is registered under that key (server-rocksdb passed on fix(api): allow anonymous cypher queries #3366).
  • test-start-server.sh (new, second commit) runs start-server.sh twice for each backend (hstore, hbase, rocksdb, memory) on a copy of the packaged config, with init-store.sh and start-hugegraph.sh stubbed. It fails when the second start changes the config, or when usePD, the two hbase timeouts or schema.sync_deletion is missing, set twice or set for the wrong backend. It runs in the Check startup and native runtime contracts step of the rocksdb job, which the planner selects for every hugegraph-dist change, so it still runs when the hstore and hbase jobs are skipped.
  • The CI planner is left as it is: a change to start-server.sh or run-api-test.sh still selects neither hstore nor hbase. This PR's CI runs the hbase job only because it now touches server-tests.yml, and it still skips hstore, so the hstore run below is from a Linux host. Selecting hstore and hbase for these two scripts in .github/scripts/ci-policy.py would run the real backends on the next change too. I can add that here or in a follow-up if wanted.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • test-start-server.sh on macOS (bash 3.2) and on Ubuntu 24.04 (bash 5.2), 2026-10-17: it passes with this change, and with the start-server.sh of master f5d9885 it fails 11 checks and exits 1. Count of each appended line after the two starts, as the test reports it:

      Backend Line master f5d9885 this PR
      hstore usePD=true 2 1
      hbase restserver.request_timeout=200 and gremlinserver.timeout=200 2 each 1 each
      hstore, hbase, rocksdb, memory schema.sync_deletion=true 2 1

      Negative control: git show f5d9885a5:hugegraph-server/hugegraph-dist/src/assembly/travis/start-server.sh > /tmp/start-server.sh, then hugegraph-server/hugegraph-dist/src/assembly/travis/test-start-server.sh /tmp/start-server.sh.

    • The test also fails against three broken copies of start-server.sh: one that writes nothing, one that appends usePD=true for every backend, and one whose second start exits 1.

    • CI of this PR at effa296 (run 39052910053): test-start-server.sh passes in the Check startup and native runtime contracts step of the rocksdb job (job 117455233209).

    • The API test step of the hstore job, as pd-store-ci.yml runs it (mvn clean package, install-backend.sh hstore, then run-api-test.sh hstore target/site/jacoco), on Ubuntu 24.04 x86_64, JDK 17.0.20, 2026-10-17, with a fresh PD and Store for each run:

      • with the start-server.sh of master f5d9885: the first start and CypherAnonymousApiTest (2 run, 0 failures) pass, then the init-store.sh of the second start fails with Invalid value for key 'usePD': '[true, true]', and run-api-test.sh exits 1.
      • with this change (ae42b68): both starts come up. CypherAnonymousApiTest: 2 run, 0 failures. API suite: 191 run, 0 failures, 0 errors, 53 skipped. run-api-test.sh exits 0, and rest-server.properties holds usePD=true once. The second commit does not change start-server.sh.

Does this PR potentially affect the following parts?

Documentation Status

Select one option and provide the documentation location when applicable.

  • Doc - TODO: required documentation is pending; complete it before merging.
  • Doc - Done: documentation is included here or linked below.
  • Doc - No Need: no user-visible documentation is affected.

Documentation files in this PR or paired hugegraph-doc PR:

run-api-test.sh now starts the Server twice on the same configuration,
first without authentication for CypherAnonymousApiTest and then with
it (apache#3366). start-server.sh appended its config lines
on every call, so with hstore the second start read usePD as
'[true, true]' and failed with "Invalid value for key 'usePD'", which
fails the API test step of the hstore job.

Append each line only when the file does not already hold it. This
also covers the two hbase timeouts and schema.sync_deletion, which were
appended the same way.
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.60%. Comparing base (92af2f8) to head (effa296).
⚠️ Report is 29 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3371      +/-   ##
============================================
+ Coverage     54.31%   57.60%   +3.29%     
+ Complexity     2250        3    -2247     
============================================
  Files           770      507     -263     
  Lines         67952    48882   -19070     
  Branches       9213     7071    -2142     
============================================
- Hits          36905    28160    -8745     
+ Misses        27470    18024    -9446     
+ Partials       3577     2698     -879     
Flag Coverage Δ
server_hbase 41.89% <ø> (?)
server_memory 54.30% <ø> (?)
server_rocksdb 42.28% <ø> (?)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bitflicker64 bitflicker64 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.

Blocking: no. Summary: The append_once guard fixes the doubled usePD, hbase timeout and schema.sync_deletion lines for both starts in run-api-test.sh; the only gap is that CI on this PR does not run the hstore or hbase jobs that exercise the changed lines. Evidence: ran the head start-server.sh three times per backend (hstore, hbase, rocksdb) on one copy of the packaged conf with init-store.sh and start-hugegraph.sh stubbed, each appended line ends up exactly once; gh pr checks 3371 shows pd_store and compatibility / build-server-backends as SKIPPED; .github/scripts/ci-policy.py selects hstore for a hugegraph-dist path only when it contains pd, store or distributed.

# Set usePD=true for hstore
if [ "$BACKEND" == "hstore" ]; then
echo "usePD=true" >> $REST_CONF
append_once "usePD=true" "$REST_CONF"

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.

Minor: This line is the fix for the hstore job, but the CI of this PR never runs it: gh pr checks 3371 lists pd_store and compatibility / build-server-backends (hbase) as SKIPPED. .github/scripts/ci-policy.py maps a hugegraph-dist/ path to {server, docker, macos, macos_full} and adds hstore only when the path contains pd, store or distributed, so start-server.sh and run-api-test.sh never select hstore or hbase. That is how #3366 merged with the hstore API step broken, and the next change to these two scripts would hit the same blind spot. Requested change: add TRAVIS + "start-server.sh" and TRAVIS + "run-api-test.sh" to the planner with {hstore, hbase} (you offered this in the description; doing it here also lets this PR's own CI run the hstore API step instead of relying on the out-of-CI Ubuntu run).

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.

effa296 covers these lines without the hstore and hbase jobs. test-start-server.sh runs start-server.sh twice per backend and checks that usePD=true (hstore), both timeouts (hbase) and schema.sync_deletion=true (all backends) each end up once, only for their backend, and that the second start changes nothing. It runs in the rocksdb job, which every hugegraph-dist change selects, and fails on master's script. Touching server-tests.yml also selects the hbase job, so this PR's CI now runs the real hbase API step with both starts. The planner change is not in this PR: it would add hstore and hbase runs to every change to these two scripts, so it is a separate decision.

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Independent cross-review on 2026-10-17 at ae42b68cd0bab3d8b1dd3aaa04d8be70a069b1db: 8.5/10. No new blocking defect found in this narrow, one-file repair. I recommend prioritizing it as the shared startup dependency for 🔗 Server #3368 and 🔗 Server #3369, with the integration evidence limits below.

Two independent source/behavior passes checked the literal whole-line append guard and the actual two-start caller. In bounded cloud tests, the exact current start-server.sh, utility code and packaged configuration were exercised three times per backend (HStore, HBase, RocksDB and memory), with backend initialization and Server launch stubbed. Applicable properties remained present exactly once. Shell syntax passed; HBase's evaluation timeout and Java/JaCoCo launch arguments remained intact. This verifies script behavior, not live backend startup.

The implementation is appropriately small for sequential CI starts. It prevents adding a second identical line; it does not normalize already-duplicated keys, conflicting values or differently formatted properties, and it is not a concurrent configuration editor. Those limitations predate this fix and do not require expanding its scope.

The existing planner-coverage observation remains valid and is not repeated as a new inline finding: current CI skips HStore and HBase. The author's real Ubuntu negative/positive HStore API run (191 tests, zero failures/errors, 53 skipped on the fixed version) is useful separately attributed evidence; I did not independently rerun that Java/backend suite. A small committed repeat-start regression would help retain coverage even when the integration planner skips these jobs.

After this fix is on the tested base, the dependent PRs still need fresh integration evidence; their old failing workflows do not become successful retroactively.

Version-bound implementation.

run-api-test.sh starts the Server twice on one configuration, and the
CI planner does not select the hstore or hbase jobs for a change to
start-server.sh, so a regression there can merge unnoticed.

Add test-start-server.sh, which runs start-server.sh twice for hstore,
hbase, rocksdb and memory on a copy of the packaged config, with
init-store.sh and start-hugegraph.sh stubbed. It fails when the second
start changes the config, or when usePD, the two hbase timeouts or
schema.sync_deletion is missing, set twice or set for the wrong
backend. Run it in the rocksdb job with the other startup contract
tests.
@bitflicker64

Copy link
Copy Markdown
Contributor Author

effa296 adds the repeat-start regression as a second commit on top of ae42b68. test-start-server.sh runs start-server.sh twice for hstore, hbase, rocksdb and memory on a copy of the packaged config, with init-store.sh and start-hugegraph.sh stubbed, and fails if the second start changes the config or if usePD, the hbase timeouts or schema.sync_deletion is missing, doubled or set for the wrong backend. It runs in the rocksdb job, which the planner selects for every hugegraph-dist change, and passes there (job). With master's start-server.sh it fails 11 checks, on macOS and Ubuntu 24.04. #3355 adds a test at the same path, so whichever PR lands second needs a rebase.

@imbajin
imbajin merged commit db85924 into apache:master Oct 17, 2026
15 checks passed
@imbajin
imbajin deleted the fix/ci-start-server-twice branch October 17, 2026 20:26
byteayan added a commit to byteayan/hugegraph that referenced this pull request Oct 17, 2026
master now carries apache#3371, which makes the start-server.sh config lines
idempotent and adds its own test-start-server.sh. Take master's
start-server.sh, test-start-server.sh and server-tests.yml in place of
this branch's equivalent fix; keep the CONTRACT_SUITES mapping, which
master does not have.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants