o
    rri                     @   s   d dl Z d dlmZ d dlZddlmZmZ ddlmZm	Z	 ej
j deddfdd	Zej
j deddfd
dZej
j deddfddZdS )    N)Path   )
submissionutils)FakeExecutor_three_timetmp_pathreturnc                    s   t  }t| d}|td}||  }tj	dt
|jd tj|jjd W d    n1 s6w   Y  |I d H }|dksFJ d S Nfolder   slurm_TEST_CLUSTER_SLURM_JOB_ID   )asyncioget_running_loopr   submitr   create_task	awaitableresultr   environment_variablesstrjob_idr   process_jobpathsr   r   
event_loopexecutorjobresult_taskr    r#   L/home/ubuntu/.local/lib/python3.10/site-packages/submitit/core/test_async.pytest_result   s   

r%   c                    s   t  }t| d}|td}||  }tj	dt
|jd tj|jjd W d    n1 s6w   Y  |I d H }|dgksGJ d S r
   )r   r   r   r   r   r   r   resultsr   r   r   r   r   r   r   r   r   r#   r#   r$   test_results_single   s   

r'   c                    s   t | d}|td}tjdt|jd tj|j	j
d W d    n1 s)w   Y  d}|  D ]}|I d H }|d7 }|dksGJ q6|dksNJ d S )Nr   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   results_as_completed)r   r    r!   countawsr   r#   r#   r$   test_results_ascompleted_single(   s   

r+   )r   pathlibr   pytest r   r   	test_corer   r   markr%   r'   r+   r#   r#   r#   r$   <module>   s   