File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_fork1.cpython-37.pyc
B
��g� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlmZm
Z
mZmZ e
ed� G dd� de
�Zdd � Zed
kr�e�� dS )z.This test checks for correct fork() behavior.
� N)�ForkWait)�
reap_children�
get_attribute�
import_module�verbose�forkc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�ForkTestc C sr t �� d }x6t �� |krBt�|tj�\}}||kr6P t �d� qW | �||� | �|dd|d@ |d? f � d S )Ng $@g�������?r zcause = %d, exit = %d� � )�timeZ monotonic�os�waitpid�WNOHANG�sleepZassertEqual)�selfZcpidZdeadlineZspid�status� r �+/usr/local/lib/python3.7/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|t
d � t�d� n|�� | �|� W d
yt�
|tj� W n tk
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�<