ci(e2e): 代理状态 ping 等待 Velocity 绑定端口,旧 release 安装检查跳过其后才有的 timer

This commit is contained in:
Lemon-miaow committed 2026-09-25 02:15:11 +08:00
1 parent f8f112b8ca
commit a660b01efa
2 files changed
+18 -6

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ jobs:
- name: Check the release install - name: Check the release install
if: steps.release.outputs.tag != '' if: steps.release.outputs.tag != ''
run: sudo bash deploy/e2e_check.sh install run: sudo bash deploy/e2e_check.sh release
- name: Upgrade to this commit - name: Upgrade to this commit
if: steps.release.outputs.tag != '' if: steps.release.outputs.tag != ''
+17 -5
View File
@@ -4,6 +4,7 @@
# #
# sudo bash deploy/e2e_check.sh install # after the first run # sudo bash deploy/e2e_check.sh install # after the first run
# sudo bash deploy/e2e_check.sh rerun # after the same commit ran again # sudo bash deploy/e2e_check.sh rerun # after the same commit ran again
# sudo bash deploy/e2e_check.sh release # after the newest release installed
# sudo bash deploy/e2e_check.sh upgrade # after this commit ran over a release # sudo bash deploy/e2e_check.sh upgrade # after this commit ran over a release
# #
# It asks what an operator's first minutes ask: the binary runs, the control plane is # It asks what an operator's first minutes ask: the binary runs, the control plane is
@@ -12,7 +13,7 @@
# (it restarts only when what it runs changed) and keep every earlier answer. # (it restarts only when what it runs changed) and keep every earlier answer.
set -euo pipefail set -euo pipefail
phase="${1:?usage: e2e_check.sh install|rerun|upgrade}" phase="${1:?usage: e2e_check.sh install|rerun|release|upgrade}"
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
KUBECTL=(/usr/local/bin/k3s kubectl) KUBECTL=(/usr/local/bin/k3s kubectl)
PID_FILE=/var/tmp/felis-e2e-velocity.pid PID_FILE=/var/tmp/felis-e2e-velocity.pid
@@ -43,9 +44,12 @@ check "felis-api is ready (database and cluster reachable)" \
for unit in k3s postgresql felis-velocity; do for unit in k3s postgresql felis-velocity; do
check "${unit} is active" systemctl is-active --quiet "$unit" check "${unit} is active" systemctl is-active --quiet "$unit"
done done
for timer in felis-db-backup.timer felis-watchdog.timer; do # A release may predate a timer; what this commit installs has them all.
check "${timer} is scheduled" systemctl is-enabled --quiet "$timer" if [ "$phase" != release ]; then
done for timer in felis-db-backup.timer felis-watchdog.timer; do
check "${timer} is scheduled" systemctl is-enabled --quiet "$timer"
done
fi
# A status ping is the proxy's own answer (ping passthrough is off), so it proves the JRE, # A status ping is the proxy's own answer (ping passthrough is off), so it proves the JRE,
# Velocity and its config without a login gate or a Mojang account. # Velocity and its config without a login gate or a Mojang account.
@@ -90,6 +94,14 @@ while len(data) < size:
print(json.loads(data)["version"]["name"]) print(json.loads(data)["version"]["name"])
EOF EOF
} }
# The installer returns once the unit is started; the JVM binds the port a few
# seconds later.
for _ in $(seq 30); do
if version="$(ping_proxy 2>&1)"; then
break
fi
sleep 2
done
if version="$(ping_proxy 2>&1)"; then if version="$(ping_proxy 2>&1)"; then
pass "the proxy answers a status ping (${version})" pass "the proxy answers a status ping (${version})"
else else
@@ -98,7 +110,7 @@ fi
pid="$(systemctl show -p MainPID --value felis-velocity)" pid="$(systemctl show -p MainPID --value felis-velocity)"
case "$phase" in case "$phase" in
install) printf '%s\n' "$pid" > "$PID_FILE" ;; install | release) printf '%s\n' "$pid" > "$PID_FILE" ;;
rerun) rerun)
if [ "$pid" = "$(cat "$PID_FILE" 2>/dev/null)" ]; then if [ "$pid" = "$(cat "$PID_FILE" 2>/dev/null)" ]; then
pass "the rerun left the proxy running (pid ${pid})" pass "the rerun left the proxy running (pid ${pid})"