@@ -194,6 +194,44 @@ if [[ "$SYNC_OK" != "true" ]]; then
194194 exit 1
195195fi
196196
197+ echo " Verifying repeated okdev up reuses active sync"
198+ SYNC_PID_BEFORE=$( printf ' %s' " $STATUS_OUTPUT " | sync_pid_from_status)
199+ if [[ -z " $SYNC_PID_BEFORE " ]]; then
200+ echo " ERROR: expected status to include running sync pid before repeated up" >&2
201+ echo " $STATUS_OUTPUT " >&2
202+ exit 1
203+ fi
204+ SYNC_LOG_LINES_BEFORE=$( wc -l < " $SYNC_HOME /local.log" )
205+ REPEAT_UP_OUTPUT=$( " $OKDEV_BIN " --config " $CFG_PATH " --session " $SESSION_NAME " up --wait-timeout 5m)
206+ echo " $REPEAT_UP_OUTPUT "
207+ if [[ " $REPEAT_UP_OUTPUT " != * " reused existing workload" * ]]; then
208+ echo " ERROR: expected repeated up to reuse existing pod workload" >&2
209+ exit 1
210+ fi
211+ if [[ " $REPEAT_UP_OUTPUT " != * " sync: already active" * ]]; then
212+ echo " ERROR: expected repeated up to report already-active sync" >&2
213+ exit 1
214+ fi
215+ REPEAT_STATUS=$( " $OKDEV_BIN " --config " $CFG_PATH " --session " $SESSION_NAME " status --details)
216+ echo " $REPEAT_STATUS "
217+ SYNC_PID_AFTER=$( printf ' %s' " $REPEAT_STATUS " | sync_pid_from_status)
218+ if [[ " $SYNC_PID_AFTER " != " $SYNC_PID_BEFORE " ]]; then
219+ echo " ERROR: expected sync pid to remain $SYNC_PID_BEFORE after repeated up, got ${SYNC_PID_AFTER:- missing} " >&2
220+ exit 1
221+ fi
222+ if [[ " $REPEAT_STATUS " != * " health: active" * ]]; then
223+ echo " ERROR: expected sync health to remain active after repeated up" >&2
224+ exit 1
225+ fi
226+ SYNC_LOG_LINES_AFTER=$( wc -l < " $SYNC_HOME /local.log" )
227+ if [[ $(( SYNC_LOG_LINES_AFTER - SYNC_LOG_LINES_BEFORE)) -gt 5 ]]; then
228+ echo " ERROR: expected repeated up not to restart or churn sync log" >&2
229+ tail -20 " $SYNC_HOME /local.log" >&2
230+ exit 1
231+ fi
232+ STATUS_OUTPUT=" $REPEAT_STATUS "
233+ echo " Repeated okdev up sync reuse verified"
234+
197235echo " Verifying remote shell and logs"
198236" $OKDEV_BIN " --config " $CFG_PATH " --session " $SESSION_NAME " ssh --setup-key --cmd ' test -f /workspace/hello.txt'
199237LOG_OUTPUT=$( " $OKDEV_BIN " --config " $CFG_PATH " --session " $SESSION_NAME " logs --all --follow=false --tail 10)
0 commit comments