fix(test): fix E2E retry — set -e broke exit-code capture

With set -Eeuo pipefail, a failing fvm flutter test exited the script
before _e2e_exit=$? could run, so the retry-on-new-display logic never
fired. Use the cmd || var=$? pattern to capture the exit code safely,
and add || true to the break guard so set -e doesn't trip on it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-15 00:10:46 +02:00
co-authored by Claude Sonnet 4.6
parent 1b7cbdbb4b
commit dd1425a497
+4 -3
View File
@@ -139,9 +139,10 @@ done
_e2e_exit=0
for _attempt in 1 2; do
ts "E2E attempt $_attempt (DISPLAY=$DISPLAY)"
timeout 360 fvm flutter test integration_test/ -d linux
_e2e_exit=$?
[ $_e2e_exit -eq 0 ] && break
# Use || to capture exit code without triggering set -e on failure.
_e2e_exit=0
timeout 360 fvm flutter test integration_test/ -d linux || _e2e_exit=$?
[ "$_e2e_exit" -eq 0 ] && break || true
if [ $_attempt -lt 2 ]; then
ts "E2E attempt $_attempt failed (exit $_e2e_exit), restarting Xvfb and retrying..."
pkill -u "$USER" -f "sharedinbox" 2>/dev/null || true