From fd523455097a7ba4425c9be3e002fd19469b044c Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Fri, 12 Jun 2026 18:06:03 +0000 Subject: [PATCH] test(e2e): poll for running container after workspace online in local-provision lifecycle RegistryHandler.Register marks the workspace 'online' as soon as the agent registers, but the ws- container may not be visible on the shared docker-host for a short moment after that. Replace the single post-online sample with a 10-second bounded poll, preserving the hard failure if no container appears. Test-only change; no product code modified. Relates-to: molecule-core#2615 Co-Authored-By: Claude --- tests/e2e/test_local_provision_lifecycle_e2e.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_local_provision_lifecycle_e2e.sh b/tests/e2e/test_local_provision_lifecycle_e2e.sh index e12d4ed4..235da18b 100755 --- a/tests/e2e/test_local_provision_lifecycle_e2e.sh +++ b/tests/e2e/test_local_provision_lifecycle_e2e.sh @@ -476,8 +476,16 @@ for _ in $(seq 1 "$ONLINE_TIMEOUT"); do done check "workspace reached online (status=$STATUS)" "online" "$STATUS" if [ "$FAIL" -gt 0 ]; then diagnose_provision "$WSID"; echo "=== Results: $PASS passed, $FAIL failed ==="; exit 1; fi -RUN=$(container_running "$WSID") -if [ -n "$RUN" ]; then pass "container running: $RUN"; else fail "no running ws-${WSID} container" "docker ps shows none"; fi +# Bounded poll: the workspace can flip to 'online' as soon as the agent +# registers, but the container may not be visible/stable on the shared +# docker-host for another moment. Retry for up to 10s before failing hard. +RUN="" +for _ in $(seq 1 10); do + RUN=$(container_running "$WSID") + if [ -n "$RUN" ]; then break; fi + sleep 1 +done +if [ -n "$RUN" ]; then pass "container running: $RUN"; else fail "no running ws-${WSID} container within 10s of online" "docker ps shows none"; fi echo "" # ---------------------------------------------------------------------------- -- 2.52.0