| Server IP : 118.27.122.248 / Your IP : 216.73.216.15 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/test/__pycache__/ |
Upload File : |
3
�
�^�p � @ s d dl Z d dlZd dlmZmZ d dlZd dlZd dlZd dlm Z dd� Z
G dd� de�ZG dd � d ej
�ZG d
d� de�ZG dd
� d
e�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZdS )� N)�start_new_thread�TIMEOUT_MAX)�supportc C s t jd� d S )Ng{�G�z�?)�time�sleep� r r �//opt/alt/python36/lib64/python3.6/lock_tests.py�_wait s r c @ s. e Zd Zddd�Zdd� Zdd� Zdd � Zd
S )�BunchFc
s| � �_ |�_g �_g �_| �_tj� �_�jj� � �fdd�}y xt |�D ]}t
|f � qNW W n d�_� Y nX d S )Nc sD t j� } �jj| � z
� � W d �jj| � x�js<t� q.W X d S )N)� threading� get_ident�started�append�finished� _can_exitr )�tid)�f�selfr r �task% s
zBunch.__init__.<locals>.taskT)r �nr
r r r �wait_threads_exit�wait_thread� __enter__�ranger )r r r Zwait_before_exitr �ir )r r r �__init__ s
zBunch.__init__c C s xt | j�| jk rt� qW d S )N)�lenr
r r )r r r r �wait_for_started6 s zBunch.wait_for_startedc C s0 xt | j�| jk rt� qW | jjd d d � d S )N)r r r r r �__exit__)r r r r �wait_for_finished: s
zBunch.wait_for_finishedc C s
d| _ d S )NT)r )r r r r � do_finish@ s zBunch.do_finishN)F)�__name__�
__module__�__qualname__r r r r r r r r r
s
r
c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�BaseTestCasec C s t j� | _d S )N)r Zthreading_setup�_threads)r r r r �setUpE s zBaseTestCase.setUpc C s t j| j� t j� d S )N)r Zthreading_cleanupr% Z
reap_children)r r r r �tearDownH s zBaseTestCase.tearDownc C s$ | j ||d � | j||d � d S )Ng333333�?g $@)ZassertGreaterEqual�
assertLess)r �actualZexpectedr r r �
assertTimeoutL s zBaseTestCase.assertTimeoutN)r! r"