You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): robust pre-flight checks and docker cleanup in run-tests.sh
root causes of Docker Desktop crash + E2E failures:
1. docker-compose unosim-server occupied port 3000 (restart: unless-stopped).
lsof kill only removed docker-proxy, container kept running/restarting.
2. stale exited sandbox containers piled up across runs (8 found).
cleanup only filtered by current ancestor image, missing old image IDs.
3. no container cleanup between Docker tests (74s) and E2E server start.
Docker Desktop became overloaded and temporarily unresponsive.
fixes:
- add pre-flight section: checks node, docker, sonarqube, port 3000
- stop docker-compose unosim-server before tests (port 3000 conflict)
- find_sandbox_containers() helper: name + command-based matching catches
containers from any image version (including unnamed/old-ID ones)
- clean stale containers in pre-flight and after Docker tests
- export FORCE_DOCKER=1 (not just inline) for reliable propagation
- docker recovery retry loop only when docker was available initially
proven: ./run-tests.sh passes all 7 steps + sonarqube quality gate
1402 unit tests, 32 docker tests, 16 E2E tests, 0 issues
[ "$_i"-eq 1 ] &&echo -e "${RUN} Docker antwortet nicht – warte auf Erholung (max. 30s)..."
233
+
sleep 3
234
+
done
235
+
fi
165
236
166
237
export PORT=3000
167
238
# Server startet im Hintergrund (NODE_ENV=development für Vite-Snapshots)
168
-
# FORCE_DOCKER + DOCKER_SANDBOX_IMAGE werden gesetzt, wenn Docker stabil verfügbar ist
169
239
if [ "$DOCKER_FOR_E2E"-eq 1 ];then
170
240
echo -e "${OK} Docker verfügbar – E2E mit Sandbox-Unterstützung"
171
-
FORCE_DOCKER=1 DOCKER_SANDBOX_IMAGE=$DOCKER_SANDBOX_IMAGE UNOSIM_SHARED_TEMP_DIR=$UNOSIM_SHARED_TEMP_DIR NODE_ENV=development npm run dev >>"$LOG_FILE"2>&1&
241
+
export FORCE_DOCKER=1
242
+
DOCKER_SANDBOX_IMAGE=$DOCKER_SANDBOX_IMAGE UNOSIM_SHARED_TEMP_DIR=$UNOSIM_SHARED_TEMP_DIR NODE_ENV=development npm run dev >>"$LOG_FILE"2>&1&
172
243
else
173
244
echo -e "${WARN} Docker nicht verfügbar – E2E im Lokal-Modus"
174
245
NODE_ENV=development npm run dev >>"$LOG_FILE"2>&1&
0 commit comments