add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
f

��_��@sfdZddlZddlZddlZddlZddlZddlmZddlm	Z	dZ
dZdZGdd	�d	ej
�ZdS)
arThis test case provides support for checking forking and wait behavior.

To test different wait behavior, override the wait_impl method.

We want fork1() semantics -- only the forking thread survives in the
child after a fork().

On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
�N)�support)�threading_helper�g�?�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ForkWaitcCs t��|_i|_d|_g|_dS)Nr)rZthreading_setup�_threading_key�alive�stop�threads)�self�r�'/usr/lib64/python3.10/test/fork_wait.py�setUps
zForkWait.setUpcCs8d|_|jD]}|��qd}|j��tj|j�dS)N�)r	r
�join�clearrZthreading_cleanupr)r�threadrrr
�tearDowns


zForkWait.tearDowncCs:|js6t��|j|<zt�t�Wqty4Yq0dS)N)r	�os�getpidr�time�sleep�
SHORTSLEEP�OSError)r�idrrr
�f'sz
ForkWait.fcCstj||d�dS)N��exitcode)rZwait_process)r�cpidrrrr
�	wait_impl/szForkWait.wait_implc	Cstt�D]*}tj|j|fd�}|��|j�|�qt�	�t
j}t|j
�tkrjt�d�|t�	�krBqjqBt|j
���}|�|ttt���|j
��}tjdvr�t��}nt��}|dkr�t�t�d}|j
D]}|j
|||kr�|d7}q�t�|�n|j|dd�dS)N)�target�argsg�������?)Z	unixware7rrr)�range�NUM_THREADS�	threading�Threadr�startr
�appendr�	monotonicrZ
SHORT_TIMEOUT�lenrr�sorted�keysZassertEqual�list�copy�sys�platformrZfork1�fork�	LONGSLEEP�_exitr)	r�ir�deadline�aZ
prefork_livesr�n�keyrrr
�	test_wait2s.






zForkWait.test_waitN)�__name__�
__module__�__qualname__rrrrr8rrrr
rs
	r)�__doc__rr.rZunittestr$�testrZtest.supportrr1rr#ZTestCaserrrrr
�<module>s