o
    پiT                     @   sB   d Z ddlZddlZddlmZmZ dd Zedkre  dS dS )z
Simple wrapper to run a test file with retry logic.

Usage:
    python3 -m sglang.test.ci.run_with_retry test_file.py [--max-attempts 2] [--retry-wait 60]
    N)TestFilerun_unittest_filesc                  C   s   t jdd} | jddd | jdtddd	 | jd
tddd	 | jdtddd	 |  }t|j|jd}t|g|jdd|j	|j
d}t| d S )Nz Run a test file with retry logic)description	test_filezThe test file to run)helpz--max-attempts   z'Maximum number of attempts (default: 2))typedefaultr   z--retry-wait<   z-Seconds to wait between retries (default: 60)z	--timeouti  z.Timeout per attempt in seconds (default: 1200))nameestimated_timeFT)filestimeout_per_filecontinue_on_errorenable_retrymax_attemptsretry_wait_seconds)argparseArgumentParseradd_argumentint
parse_argsr   r   timeoutr   r   
retry_waitsysexit)parserargsr   	exit_code r   Q/home/ubuntu/.local/lib/python3.10/site-packages/sglang/test/ci/run_with_retry.pymain   s>   	r!   __main__)__doc__r   r   sglang.test.ci.ci_utilsr   r   r!   __name__r   r   r   r    <module>   s    &
