@@ -556,6 +556,26 @@ def make_options(param_name, options, current_value, suffix=''):
556556 # Dashboard server needs local repo checkout at REPO_PATH
557557 repo_path = os .environ .get ('REPO_PATH' )
558558 if repo_path :
559+ # Refresh the launcher checkout to current origin/next before launching.
560+ # REPO_PATH only supplies the orchestration scripts (ci.sh/bootstrap_ec2);
561+ # the grind target commit is checked out on the remote box. The launcher
562+ # must stay current so grind uses the same transport (SSM) as the rest of
563+ # CI -- a drifted checkout silently falls back to the retired SSH path and
564+ # every instance times out waiting for SSH.
565+ refresh = subprocess .run (
566+ ['git' , '-C' , repo_path , 'fetch' , '--quiet' , 'origin' , 'next' ],
567+ stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True
568+ )
569+ if refresh .returncode == 0 :
570+ refresh = subprocess .run (
571+ ['git' , '-C' , repo_path , 'checkout' , '--quiet' , '--force' , 'origin/next' ],
572+ stdout = subprocess .PIPE , stderr = subprocess .STDOUT , text = True
573+ )
574+ if refresh .returncode != 0 :
575+ r .setex (run_id , 86400 ,
576+ f'Failed to refresh launcher checkout at { repo_path } :\n { refresh .stdout } \n ' .encode ())
577+ return redirect (f'/{ run_id } ' )
578+
559579 subprocess .Popen (
560580 ['bash' , '-c' , f'cd { repo_path } && RUN_ID={ run_id } CPUS={ cpus } ./ci.sh grind-test { shlex .quote (full_cmd )} { grind_time } { jobs_pct } { memsuspend_pct } { commit } ' ],
561581 stdout = subprocess .DEVNULL ,
0 commit comments