@@ -329,9 +329,11 @@ def record_storage_stage(self, stage: str) -> dict[str, Any]:
329329 def run_compact_job (
330330 self ,
331331 space : str ,
332- timeout_sec : float = 1800.0 ,
332+ timeout_sec : Optional [ float ] = None ,
333333 poll_interval : float = 2.0 ,
334334 ) -> dict [str , Any ]:
335+ if timeout_sec is None :
336+ timeout_sec = float (os .environ .get ("MICROBENCH_COMPACT_TIMEOUT" , "3600" ))
335337 started = time .monotonic ()
336338 self .check_resp_succeeded (self .execute (f"USE `{ space } `" ))
337339 resp = self .execute ("SUBMIT JOB COMPACT" )
@@ -364,8 +366,24 @@ def run_compact_job(
364366 break
365367 time .sleep (poll_interval )
366368 else :
369+ # Harness diagnostics only; do not alter compact semantics.
370+ jobs_diag = ""
371+ try :
372+ all_jobs = self .execute ("SHOW JOBS" )
373+ if all_jobs .is_succeeded ():
374+ rows = []
375+ jkeys = _keys (all_jobs )
376+ for i in range (min (all_jobs .row_size (), 20 )):
377+ cells = _row_cells (all_jobs .row_values (i ))
378+ rows .append (
379+ {jkeys [j ]: _cell_str (cells [j ]) for j in range (len (jkeys ))}
380+ )
381+ jobs_diag = f" SHOW JOBS(sample)={ rows } "
382+ except Exception as exc : # noqa: BLE001
383+ jobs_diag = f" SHOW JOBS failed: { exc } "
367384 raise RuntimeError (
368385 f"timeout waiting for COMPACT job { job_id } last={ last_status } "
386+ f"{ jobs_diag } "
369387 )
370388 if last_status != "FINISHED" :
371389 raise RuntimeError (f"COMPACT job { job_id } ended with { last_status } " )
0 commit comments