File: //opt/cppython/lib/python3.8/test/__pycache__/test_fork1.cpython-38.pyc
U
.D�g� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlmZm
Z
mZ e
ed� G dd� de
�Zdd � Zed
kr�e�� dS )z.This test checks for correct fork() behavior.
� N)�ForkWait)�
reap_children�
get_attribute�verbose�forkc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�ForkTestc C sn t �� d }t �� |kr@t�|tj�\}}||kr4q@t �d� q| �||� | �|dd|d@ |d? f � d S )Ng $@g�������?r zcause = %d, exit = %d� � )�time� monotonic�os�waitpid�WNOHANG�sleepZassertEqual)�selfZcpid�deadlineZspid�status� r �./opt/cppython/lib/python3.8/test/test_fork1.py� wait_impl s zForkTest.wait_implc s� t �� �d�d�d� � ���fdd�}t j|d�}|�� ��� t�� }zR|s�t��}|� krlt�d� q�t
dkr|td � t�d� n|�� | �|� W 5 zt�|tj � W n t
k
r� Y nX X d
S )zFCheck fork() in main thread works while a subthread is doing an importzfake test module�partialZcompletec s: t �� �tj�<