403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.153
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_concurrent_futures.cpython-36.pyc
3

�w2_�q�@svddlZejjd�ejjd�ejjd�ddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZmZmZmZmZmZddlmZeddfd	d
�Zeed�Zeed�Zeed�Zeed�Zeee�d�Zeed
d�Zdd�Z dd�Z!dd�Z"Gdd�de#�Z$dd�Z%Gdd�dej&�Z'Gdd�d�Z(Gdd�de(�Z)Gdd �d e(�Z*Gd!d"�d"�Z+Gd#d$�d$e)e+e'�Z,Gd%d&�d&e*e+e'�Z-Gd'd(�d(�Z.Gd)d*�d*e)e.e'�Z/Gd+d,�d,e*e.e'�Z0Gd-d.�d.�Z1Gd/d0�d0e)e1e'�Z2Gd1d2�d2e*e1e'�Z3Gd3d4�d4�Z4Gd5d6�d6e)e4e'�Z5Gd7d8�d8e*e4e'�Z6Gd9d:�d:e'�Z7ejj8d;d<��Z9e:d=k�rre9�dS)>�NZ_multiprocessingzmultiprocessing.synchronize�	threading)�assert_python_ok)�futures)�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�Future)�BrokenProcessPoolcCst�}||_||_||_|S)N)r
�_state�
_exceptionZ_result)�state�	exception�result�f�r�A/opt/alt/python36/lib64/python3.6/test/test_concurrent_futures.py�
create_futures
r)r)rr�*)rrcCs||S)Nr)�x�yrrr�mul,srcCstj|�td��dS)Nzthis is an exception)�time�sleep�	Exception)�trrr�sleep_and_raise0s
rcCs tj|�t|�tjj�dS)N)rr�print�sys�stdout�flush)r�msgrrr�sleep_and_print4s
r#c@seZdZdd�ZdS)�MyObjectcCsdS)Nr)�selfrrr�	my_method;szMyObject.my_methodN)�__name__�
__module__�__qualname__r&rrrrr$:sr$cCst�S)N)r$)�_rrr�make_dummy_object?sr+c@seZdZdd�Zdd�ZdS)�BaseTestCasecCstjj�|_dS)N)�test�supportZthreading_setup�_thread_key)r%rrr�setUpDszBaseTestCase.setUpcCstjj�tjj|j�dS)N)r-r.�
reap_childrenZthreading_cleanupr/)r%rrr�tearDownGs
zBaseTestCase.tearDownN)r'r(r)r0r2rrrrr,Csr,cs4eZdZdZ�fdd�Z�fdd�Zdd�Z�ZS)�
ExecutorMixin�csft�j�tj�|_y|j|jd�|_Wn0tk
rX}z|j	t
|��WYdd}~XnX|j�dS)N)�max_workers)�superr0r�	monotonic�t1�
executor_type�worker_count�executor�NotImplementedErrorZskipTest�str�_prime_executor)r%�e)�	__class__rrr0Os

 zExecutorMixin.setUpcsV|jjdd�d|_tj�|j}tjjr:td|dd�|j	|dd�t
�j�dS)NT)�waitz%.2fs� )�endi,z+synchronization issue: test lasted too long)r;�shutdownrr7r8r-r.�verboserZ
assertLessr6r2)r%Zdt)r@rrr2YszExecutorMixin.tearDowncs2�fdd�t�j�D�}x|D]}|j�qWdS)Ncsg|]}�jjtjd��qS)g�������?)r;�submitrr)�.0r*)r%rr�
<listcomp>gsz1ExecutorMixin._prime_executor.<locals>.<listcomp>)�ranger:r)r%rrr)r%rr>ds

zExecutorMixin._prime_executor)r'r(r)r:r0r2r>�
__classcell__rr)r@rr3Ls
r3c@seZdZejZdS)�ThreadPoolMixinN)r'r(r)r�ThreadPoolExecutorr9rrrrrKnsrKc@seZdZejZdS)�ProcessPoolMixinN)r'r(r)r�ProcessPoolExecutorr9rrrrrMrsrMc@s$eZdZdd�Zdd�Zdd�ZdS)�ExecutorShutdownTestcCs$|jj�|jt|jjtdd�dS)N�r4)r;rD�assertRaises�RuntimeErrorrF�pow)r%rrr�test_run_after_shutdownws
z,ExecutorShutdownTest.test_run_after_shutdowncCs:tddj|jjd��\}}}|j|�|j|j�d�dS)Nz-caif 1:
            from concurrent.futures import {executor_type}
            from time import sleep
            from test.test_concurrent_futures import sleep_and_print
            t = {executor_type}(5)
            t.submit(sleep_and_print, 1.0, "apple")
            )r9sapple)r�formatr9r'�assertFalse�assertEqual�strip)r%Zrc�out�errrrr�test_interpreter_shutdown}s
z.ExecutorShutdownTest.test_interpreter_shutdowncs:�fdd�td�D�}�jj�x|D]}|j�q&WdS)Ncsg|]}�jjtjd��qS)g�������?)r;rFrr)rGr*)r%rrrH�sz=ExecutorShutdownTest.test_hang_issue12364.<locals>.<listcomp>�2)rIr;rDr)r%�fsrr)r%r�test_hang_issue12364�s

z)ExecutorShutdownTest.test_hang_issue12364N)r'r(r)rTr[r^rrrrrOvsrOc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ThreadPoolShutdownTestcCsdS)Nr)r%rrrr>�sz&ThreadPoolShutdownTest._prime_executorcCsl|jjtdd�|jjtdd�|jjtdd�|jt|jj�d�|jj�x|jjD]}|j�qXWdS)N�rP����)r;rFrrW�len�_threadsrD�join)r%rrrr�test_threads_terminate�s
z-ThreadPoolShutdownTest.test_threads_terminatecCsjtjdd��<}|}|jt|jttdd���ddddddddddg
�WdQRXx|jD]}|j�qVWdS)	Nr4)r5�rcrP�r���)	rrLrW�list�map�absrIrfrg)r%r?r;rrrr�test_context_manager_shutdown�s$z4ThreadPoolShutdownTest.test_context_manager_shutdowncCs@tjdd�}|jttdd��|j}~x|D]}|j�q,WdS)Nr4)r5rk)rrLrmrnrIrfrg)r%r;�threadsrrrr�test_del_shutdown�s
z(ThreadPoolShutdownTest.test_del_shutdowncCsPtjddd�}|jttdd��|j}~x"|D]}|j|jd�|j�q.WdS)Nr4ZSpecialPool)r5Zthread_name_prefixz^SpecialPool_[0-4]$rk)	rrLrmrnrIrf�assertRegex�namerg)r%r;rprrrr�test_thread_names_assigned�s

z1ThreadPoolShutdownTest.test_thread_names_assignedcCsNtjdd�}|jttdd��|j}~x"|D]}|j|jd�|j�q,WdS)Nr4)r5zThreadPoolExecutor-\d+_[0-4]$rk)	rrLrmrnrIrfrrrsrg)r%r;rprrrr�test_thread_names_default�s
z0ThreadPoolShutdownTest.test_thread_names_defaultN)	r'r(r)r>rhrorqrtrurrrrr_�s			r_c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�ProcessPoolShutdownTestcCsdS)Nr)r%rrrr>�sz'ProcessPoolShutdownTest._prime_executorcCst|jjtdd�|jjtdd�|jjtdd�|jt|jj�d�|jj}|jj�x|j�D]}|j�q`WdS)Nr`rPrarbrcrdr4)	r;rFrrWre�
_processesrD�valuesrg)r%�	processes�prrr�test_processes_terminate�s
z0ProcessPoolShutdownTest.test_processes_terminatecCsntjdd��>}|j}|jt|jttdd���ddddddddddg
�WdQRXx|j�D]}|j	�qZWdS)	Nr4)r5rircrPrjrrk)
rrNrwrWrlrmrnrIrxrg)r%r?ryrzrrrro�s$z5ProcessPoolShutdownTest.test_context_manager_shutdowncCsltjdd�}t|jttdd���|j}|j}|j}~|j	�x|j
�D]}|j	�qHW|j�|j�dS)Nr4)r5rk)
rrNrlrmrnrIZ_queue_management_threadrwZ_call_queuergrx�closeZjoin_thread)r%r;Zqueue_management_threadryZ
call_queuerzrrrrq�sz)ProcessPoolShutdownTest.test_del_shutdownN)r'r(r)r>r{rorqrrrrrv�s	rvc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�	WaitTestscCsd|jjtdd�}|jjtjd�}tjt||gtjd�\}}|j	t
|g�|�|j	t
t|g�|�dS)Nr`rPg�?)�return_when)r;rFrrrrrA�CANCELLED_FUTURE�FIRST_COMPLETEDrW�set)r%�future1�future2�doneZnot_donerrr�test_first_completed�szWaitTests.test_first_completedcCsT|jjtjd�}tjtt|gtjd�\}}|j	t
ttg�|�|j	t
|g�|�dS)Ng�?)r~)r;rFrrrrA�CANCELLED_AND_NOTIFIED_FUTURE�SUCCESSFUL_FUTUREr�rWr�)r%r��finished�pendingrrr�+test_first_completed_some_already_completed�s
z5WaitTests.test_first_completed_some_already_completedcCsr|jjtdd�}|jjtd�}|jjtjd�}tj|||gtjd�\}}|j	t
||g�|�|j	t
|g�|�dS)NrPr`g�?rc)r~)r;rFrrrrrrA�FIRST_EXCEPTIONrWr�)r%r�r�Zfuture3r�r�rrr�test_first_exception	szWaitTests.test_first_exceptioncCsl|jjtdd�}|jjtjd�}tjttt	||gtj
d�\}}|jttt	|g�|�|jtt|g�|�dS)Nr`rg�?)r~)
r;rF�divmodrrrrAr�rr�r�rWr�)r%r�r�r�r�rrr�*test_first_exception_some_already_completesz4WaitTests.test_first_exception_some_already_completecCsP|jjtjd�}tjt|gtjd�\}}|jt	tg�|�|jt	|g�|�dS)NrP)r~)
r;rFrrrrA�EXCEPTION_FUTUREr�rWr�)r%r�r�r�rrr�'test_first_exception_one_already_failed%sz1WaitTests.test_first_exception_one_already_failedcCsj|jjtdd�}|jjtdd�}tjttt||gtj	d�\}}|j
tttt||g�|�|j
t�|�dS)NrPrr`)r~)r;rFr�rrrAr�r�r��
ALL_COMPLETEDrWr�)r%r�r�r�r�rrr�test_all_completed/szWaitTests.test_all_completedcCsn|jjtdd�}|jjtjd�}tjttt	||gdtj
d�\}}|jtttt	|g�|�|jt|g�|�dS)Nrarbr4)�timeoutr~)
r;rFrrrrrAr�r�r�r�rWr�)r%r�r�r�r�rrr�test_timeoutBszWaitTests.test_timeoutN)
r'r(r)r�r�r�r�r�r�r�rrrrr}�s
r}c@seZdZdd�ZdS)�ThreadPoolWaitTestscsltj���fdd��tj�}tjd�z4��fdd�td�D�}�j�tj|tj	d�Wdtj|�XdS)Ncs�j�dS)N)rAr)�eventrr�future_func[sz@ThreadPoolWaitTests.test_pending_calls_race.<locals>.future_funcg���ư>csh|]}�jj���qSr)r;rF)rG�i)r�r%rr�	<setcomp>`sz>ThreadPoolWaitTests.test_pending_calls_race.<locals>.<setcomp>�d)r~)
r�Eventr�getswitchinterval�setswitchintervalrIr�rrAr�)r%Zoldswitchintervalr]r)r�r�r%r�test_pending_calls_raceWs
z+ThreadPoolWaitTests.test_pending_calls_raceN)r'r(r)r�rrrrr�Usr�c@seZdZdS)�ProcessPoolWaitTestsN)r'r(r)rrrrr�gsr�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�AsCompletedTestscCsV|jjtdd�}|jjtdd�}ttjttt||g��}|j	tttt||g�|�dS)NrPr`rbra)
r;rFrr�r�as_completedr�r�r�rW)r%r�r��	completedrrr�test_no_timeoutmsz AsCompletedTests.test_no_timeoutc
Csv|jjtjd�}t�}y.x(tjttt	|gdd�D]}|j
|�q0WWntjk
rZYnX|jtttt	g�|�dS)NrPr)r�)
r;rFrrr�rr�r�r�r��add�TimeoutErrorrW)r%r�Zcompleted_futures�futurerrr�test_zero_timeout}s z"AsCompletedTests.test_zero_timeoutcCs@|jjtjd�}dd�tjtj|d��D�}|jt	|�d�dS)NrPcSsg|]}|�qSrr)rGrrrrrH�sz;AsCompletedTests.test_duplicate_futures.<locals>.<listcomp>rcrj)
r;rFrrrr��	itertools�repeatrWre)r%r�r�rrr�test_duplicate_futures�sz'AsCompletedTests.test_duplicate_futurescCs�dd�td�D�}|jttd��|jttdd��|jtj��@x8tj|dd�D]&}|j	|�t
j|�}~|j|��qRWWdQRX|dj
d	�xFtj|�D]8}|j	|�t
j|�}~|j|��|r�|dj
d	�q�WdS)
NcSsg|]
}t��qSr)r
)rGr*rrrrH�szGAsCompletedTests.test_free_reference_yielded_future.<locals>.<listcomp>�)rr)rrr)r�r-)rI�appendrrr	rQrr�r��remove�weakref�ref�assertIsNone�
set_result)r%�futures_listr��wrrrr�"test_free_reference_yielded_future�s"



z3AsCompletedTests.test_free_reference_yielded_futurecCsLttttg}|jtj��}ttj|dd��WdQRX|j	t
|j�d�dS)Nr)r�z2 (of 4) futures unfinished)r��PENDING_FUTURE�RUNNING_FUTUREr�rQrr�rlr�rWr=r)r%r��cmrrr�"test_correct_timeout_exception_msg�s
z3AsCompletedTests.test_correct_timeout_exception_msgN)r'r(r)r�r�r�r�r�rrrrr�ks

r�c@seZdZdS)�ThreadPoolAsCompletedTestsN)r'r(r)rrrrr��sr�c@seZdZdS)�ProcessPoolAsCompletedTestsN)r'r(r)rrrrr��sr�c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
jd
d��Zdd�Z
dd�ZdS)�ExecutorTestcCs$|jjtdd�}|jd|j��dS)NrPr��)r;rFrSrWr)r%r�rrr�test_submit�szExecutorTest.test_submitcCs&|jjtddd�}|jd|j��dS)NrPr�)r�)r;rFrrWr)r%r�rrr�test_submit_keyword�sz ExecutorTest.test_submit_keywordcCsx|jt|jjttd�td���ttttd�td����|jt|jjttd�td�dd��ttttd�td����dS)N�
rc)�	chunksize)rWrlr;rmrSrI)r%rrr�test_map�szExecutorTest.test_mapcCsR|jjtddddgddddg�}|j|j�d�|j|j�d�|jt|j�dS)NrjrPrcrr4)rrj)rrj)r;rmr�rW�__next__rQ�ZeroDivisionError)r%r�rrr�test_map_exception�s zExecutorTest.test_map_exceptioncCslg}y2x,|jjtjdddgdd�D]}|j|�q"WWntjk
rLYnX|jd�|jddg|�dS)Nrrar4)r�zexpected TimeoutError)	r;rmrrr�rr�ZfailrW)r%Zresultsr�rrr�test_map_timeout�s
zExecutorTest.test_map_timeoutcCs(|jjtdg|jd�|jj�dS)NrPrj)r;rmr=r:rD)r%rrr�test_shutdown_race_issue12456�sz*ExecutorTest.test_shutdown_race_issue12456csNt�}tj��tj|�fdd��}|jj|j�~�jdd�}|j	|d�dS)Ncs�j�S)N)r�)�obj)�my_object_collectedrr�<lambda>�sz7ExecutorTest.test_no_stale_references.<locals>.<lambda>g@)r�z-Stale reference not collected within timeout.)
r$rr�r�r�r;rFr&rA�
assertTrue)r%Z	my_objectZmy_object_callbackZ	collectedr)r�r�test_no_stale_references�sz%ExecutorTest.test_no_stale_referencescCs6x0dD](}|jtd��|j|d�WdQRXqWdS)Nrrjz"max_workers must be greater than 0)r5���)rr�)ZassertRaisesRegex�
ValueErrorr9)r%Znumberrrr�test_max_workers_negatives
z&ExecutorTest.test_max_workers_negativecCs8x2|jjttd��D]}tj|�}~|j|��qWdS)Nr�)r;rmr+rIr�r�r�)r%r�r�rrr�test_free_reference	s
z ExecutorTest.test_free_referenceN)r'r(r)r�r�r�r�r�r�r-r.Zcpython_onlyr�r�r�rrrrr��s	r�c@seZdZdd�Zdd�ZdS)�ThreadPoolExecutorTestcsDg��fdd�}|jj|td��|jjdd�|j�td��dS)zTests verifying issue 11777.cs�j|�dS)N)r�)�n)r�rr�record_finishedszRThreadPoolExecutorTest.test_map_submits_without_iteration.<locals>.record_finishedr�T)rAN)r;rmrIrDZassertCountEqual)r%r�r)r�r�"test_map_submits_without_iterations
z9ThreadPoolExecutorTest.test_map_submits_without_iterationcCs&|j�}|j|jtj�pdd�dS)Nrjr4)r9rWZ_max_workers�os�	cpu_count)r%r;rrr�test_default_workerssz+ThreadPoolExecutorTest.test_default_workersN)r'r(r)r�r�rrrrr�s
r�c@s0eZdZdd�Zdd�Zedd��Zdd�Zd	S)
�ProcessPoolExecutorTestcCsd|jjtjd�g}tt|jjj���}|j�x|D]}|j	t
|j�q4W|j	t
|jjtdd�dS)NrcrPr�)
r;rFrr�next�iterrwrxZ	terminaterQrrrS)r%rrzZfutrrr�test_killed_child$s
z)ProcessPoolExecutorTest.test_killed_childcs��fdd�}ttttd�td���}�jt�jjttd�td�dd��|��jt�jjttd�td�dd��|��jt�jjttd�td�dd��|��jt|�dS)Ncs$t�jjttd�td�dd��dS)N�(rj)r�r�)rlr;rmrSrIr)r%rr�bad_map1sz;ProcessPoolExecutorTest.test_map_chunksize.<locals>.bad_mapr�ra)r�r\)rlrmrSrIrWr;rQr�)r%r�r�r)r%r�test_map_chunksize0sz*ProcessPoolExecutorTest.test_map_chunksizecCstd��dS)N�{)rR)�clsrrr�_test_traceback@sz'ProcessPoolExecutorTest._test_tracebackcCs�|jj|j�}|jt��}|j�WdQRX|j}|jt|�t	�|j
|jd�|j}|jt|�t
jj�|jd|j�tjj��2}y|�Wn"t	k
r�tjtj��YnXWdQRX|jd|j��dS)Nr�z&raise RuntimeError(123) # some comment)r�)r;rFr�rQrrrZassertIs�typerRrW�args�	__cause__rZprocessZ_RemoteTraceback�assertIn�tbr-r.�captured_stderrr�
excepthook�exc_info�getvalue)r%r�r��exc�cause�f1rrr�test_tracebackDs z&ProcessPoolExecutorTest.test_tracebackN)r'r(r)r�r��classmethodr�r�rrrrr�#sr�c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)$�FutureTestscs:d��fdd�}t�}|j|�|jd�|jd��dS)Ncs|j��dS)N)r)�callback_future)�callback_resultrr�fn^sz6FutureTests.test_done_callback_with_result.<locals>.fnr4)r
�add_done_callbackr�rW)r%r�rr)r�r�test_done_callback_with_result\s

z*FutureTests.test_done_callback_with_resultcs@d��fdd�}t�}|j|�|jtd��|jd�j�dS)Ncs|j��dS)N)r)r�)�callback_exceptionrrr�isz9FutureTests.test_done_callback_with_exception.<locals>.fnr-)r-)r
r��
set_exceptionrrWr�)r%r�rr)r�r�!test_done_callback_with_exceptiongs
z-FutureTests.test_done_callback_with_exceptioncs<d��fdd�}t�}|j|�|j|j��|j��dS)Ncs|j��dS)N)�	cancelled)r�)�
was_cancelledrrr�tsz6FutureTests.test_done_callback_with_cancel.<locals>.fn)r
r�r��cancel)r%r�rr)r�r�test_done_callback_with_cancelrs
z*FutureTests.test_done_callback_with_cancelc
s�tjj��n}d�d��fdd�}�fdd�}t�}|j|�|j|�|jd�|j��|j��|jd|j��WdQRXdS)NFcsd�td��dS)NTzdoh!)r)r�)�raising_was_calledrr�
raising_fn�sz9FutureTests.test_done_callback_raises.<locals>.raising_fncsd�dS)NTr)r�)�
fn_was_calledrrr��sz1FutureTests.test_done_callback_raises.<locals>.fnr4zException: doh!)	r-r.r�r
r�r�r�r�r�)r%�stderrr�r�rr)r�r�r�test_done_callback_raises}s




z%FutureTests.test_done_callback_raisescs:d��fdd�}t�}|jd�|j|�|jd��dS)Ncs|j��dS)N)r)r�)r�rrr��sz=FutureTests.test_done_callback_already_successful.<locals>.fnr4)r
r�r�rW)r%r�rr)r�r�%test_done_callback_already_successful�s

z1FutureTests.test_done_callback_already_successfulcs@d��fdd�}t�}|jtd��|j|�|jd�j�dS)Ncs|j��dS)N)r)r�)r�rrr��sz9FutureTests.test_done_callback_already_failed.<locals>.fnr-)r-)r
r�rr�rWr�)r%r�rr)r�r�!test_done_callback_already_failed�s
z-FutureTests.test_done_callback_already_failedcs<d��fdd�}t�}|j|j��|j|�|j��dS)Ncs|j��dS)N)r�)r�)r�rrr��sz<FutureTests.test_done_callback_already_cancelled.<locals>.fn)r
r�r�r�)r%r�rr)r�r�$test_done_callback_already_cancelled�s
z0FutureTests.test_done_callback_already_cancelledcCsd|jtt�d�|jtt�d�|jtt�d�|jtt�d�|jtt�d�|jtt�d�dS)Nz%<Future at 0x[0-9a-f]+ state=pending>z%<Future at 0x[0-9a-f]+ state=running>z'<Future at 0x[0-9a-f]+ state=cancelled>z5<Future at 0x[0-9a-f]+ state=finished raised OSError>z3<Future at 0x[0-9a-f]+ state=finished returned int>)rr�reprr�r�rr�r�r�)r%rrr�	test_repr�s



zFutureTests.test_reprcCs�ttd�}ttd�}ttd�}ttd�}ttt�d�}ttdd�}|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�|j|j��|j	|j
t�dS)N)r)rrr4)rr)rrrrrr	�OSErrorr�r�rWrrV)r%r��f2Zf3Zf4Zf5Zf6rrr�test_cancel�s$



zFutureTests.test_cancelcCsX|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS)N)	rVr�r�r�r�rr�r�r�)r%rrr�test_cancelled�szFutureTests.test_cancelledcCsX|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS)N)	rVr�r�r�r�rr�r�r�)r%rrr�	test_done�szFutureTests.test_donecCsX|jtj��|jtj��|jtj��|jtj��|jtj��|jtj��dS)N)	rVr�Zrunningr�r�rr�r�r�)r%rrr�test_running�szFutureTests.test_runningcCsz|jtjtjdd�|jtjtjdd�|jtjtjdd�|jtjtjdd�|jt	t
jdd�|jtjdd�d�dS)Nr)r�r)
rQrr�r�rr��CancelledErrorrr�rr�rWr�)r%rrr�test_result_with_timeout�sz$FutureTests.test_result_with_timeoutcsJ�fdd�}ttd��tj|d�}|j�|j�jdd�d�|j�dS)Ncstjd��jd�dS)Nrjr)rrr�r)r�rr�notifications
z:FutureTests.test_result_with_success.<locals>.notification)r)�targetr4)r�r)rrr�Thread�startrWrrg)r%rrr)r�r�test_result_with_successs
z$FutureTests.test_result_with_successcsJ�fdd�}ttd��tj|d�}|j�|jtj�jdd�|j	�dS)Ncstjd��j�dS)Nrj)rrr�r)r�rrrs
z9FutureTests.test_result_with_cancel.<locals>.notification)r)rr4)r�)
rrrrrrQrr
rrg)r%rrr)r�r�test_result_with_cancels
z#FutureTests.test_result_with_cancelcCs�|jtjtjdd�|jtjtjdd�|jtjtjdd�|jtjtjdd�|j	t
tjdd�t��|j
tjdd�d�dS)Nr)r�)rQrr�r�rr�r
rr�r��
isinstancer�rrWr�)r%rrr�test_exception_with_timeoutsz'FutureTests.test_exception_with_timeoutcsN�fdd�}ttd��tj|d�}|j�|jt�jdd�t��|j	�dS)Nc	s8tjd��j�t�_t��_�jj�WdQRXdS)Nrj)rrZ
_conditionr	rrr
Z
notify_allr)r�rrr-s

z=FutureTests.test_exception_with_success.<locals>.notification)r)rr4)r�)
rrrrrr�rrrrg)r%rrr)r�r�test_exception_with_success,s
z'FutureTests.test_exception_with_successN)r'r(r)r�r�r�rrrrrr	r
rrrrrrrrrrrr�[s"
r�c
Cs"ztjjt�Wdtjj�XdS)N)r-r.Zrun_unittestr'r1rrrr�	test_main<sr�__main__);Ztest.supportr-r.�
import_moduleZtest.support.script_helperrr�r�rrrZunittestr�Z
concurrentrZconcurrent.futures._baserrrrr	r
Zconcurrent.futures.processrrr�r�rr�rr�r�rrr#�objectr$r+ZTestCaser,r3rKrMrOr_rvr}r�r�r�r�r�r�r�r�r�Zreap_threadsrr'rrrr�<module>s^ 



	"7'ePO8b


Youez - 2016 - github.com/yon3zu
LinuXploit