fix: stop-dev.sh incorrectly detects single-node as multi-node in Docker E2E

is_multinode() counted all [nodes.*] TOML subsections (daemon, nats, awsgw,
etc.) instead of just top-level node entries. A single-node config has ~8
such sections, causing the single-node Docker E2E to use coordinated cluster
shutdown and exit with code 254.

Fix grep to match only [nodes.X] (not [nodes.X.Y]) and preserve the original
test exit code in the cleanup trap.
This commit is contained in:
Ben Duncan
2026-02-17 22:15:49 +10:00
parent bb1fe5e485
commit c2265920eb
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -56,7 +56,8 @@ has_service() {
is_multinode() {
local config_file="$CONFIG_DIR/hive.toml"
if [ -f "$config_file" ]; then
local node_count=$(grep -c '^\[nodes\.' "$config_file")
# Count only top-level node sections [nodes.X], not subsections [nodes.X.Y]
local node_count=$(grep -cE '^\[nodes\.[^.]+\]' "$config_file")
[ "$node_count" -gt 1 ]
else
return 1
+1
View File
@@ -35,6 +35,7 @@ cleanup() {
fi
fi
./scripts/stop-dev.sh
exit $EXIT_CODE
}
trap cleanup EXIT