Skip to content

fix(test): R3 exec smoke tests need retry logic for session lock #8

@Piboonsak

Description

@Piboonsak

Problem

R3 regression tests C1/C2 fail when deploy runs while bot has active session.

Errors:

  • C1: exec date timeout 30s
  • C2: session file locked (timeout 10000ms)

File to modify

tests/r3-regression-tests.sh

Changes needed

1. Add retry helper function (before Section C)

retry_exec() {
  local cmd="$1" max=3 delay=10 attempt=1
  while [ $attempt -le $max ]; do
    result=$(docker exec "$CONTAINER" openclaw exec --text "$cmd" 2>&1) && return 0
    echo "  ⟳ Attempt $attempt/$max failed, retrying in ${delay}s..."
    sleep $delay
    attempt=$((attempt + 1))
  done
  return 1
}

2. Add pre-test wait before Section C

echo "Waiting 15s for session to settle..."
sleep 15

3. Replace direct exec calls in C1/C2 with retry_exec

Safety

  • ONLY modify tests/r3-regression-tests.sh
  • Do NOT touch any config, runtime, or bot files

Related

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions