+
    Bi                        ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^RI	H
t
HtHtHtHtHtHtHtHtHtHt R tR t ! R R	4      t ! R
 R]]]4      t]! ]! 4       ]]]]3R7       R t]R8X  d   ]P8                  ! 4        R# R# )    N)futures)support)threading_helper)CANCELLED_FUTURECANCELLED_AND_NOTIFIED_FUTUREEXCEPTION_FUTURESUCCESSFUL_FUTUREcreate_executor_testssetup_moduleBaseTestCaseThreadPoolMixinProcessPoolForkMixinProcessPoolForkserverMixinProcessPoolSpawnMixinc                     W,          # N )xys   &&=/usr/lib/python3.14/test/test_concurrent_futures/test_wait.pymulr      s	    5L    c                 8    V P                  4        \        R 4      h)zthis is an exception)wait	Exception)es   &r   wait_and_raiser      s    FFH
*
++r   c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )	WaitTestsc                    V P                   P                  \        ^^4      p\        P                  ! W.\        P
                  R7      w  r#V P                  V0V4       V P                  \        4       V4       R# )   return_whenN)executorsubmitr   r   r   ALL_COMPLETEDassertEqualset)selffuturedonenot_dones   &   r   
test_20369WaitTests.test_20369   s\    %%c1a0 v&6(/(=(=?&4()r   c                   V P                  4       pV P                  P                  \        ^^4      pV P                  P                  VP                  4      p \
        P                  ! \        W#.\
        P                  R7      w  rEV P                  \        V.4      V4       V P                  \        \        V.4      V4       VP                  4        VP                  4        R#   TP                  4        i ; i   r"   N)create_eventr$   r%   r   r   r   r   FIRST_COMPLETEDr'   r(   result)r)   eventfuture1future2r+   r,   s   &     r   test_first_completedWaitTests.test_first_completed"   s    !!#--&&sB2--&&uzz2	$\\%w8!(!8!8:ND S'^T2S"2G!<=xHIIK IIKs   A+C% %C7c                   V P                  4       pV P                  P                  VP                  4      p \        P                  ! \
        \        V.\        P                  R 7      w  r4V P                  \        \
        \        .4      V4       V P                  \        V.4      V4       VP                  4        VP                  4        R#   TP                  4        i ; ir"   N)r2   r$   r%   r   r   r   r	   r3   r'   r(   r4   r)   r5   r6   finishedpendings   &    r   +test_first_completed_some_already_completed5WaitTests.test_first_completed_some_already_completed2   s    !!#--&&uzz2
	 '35FP!(!8!8!:H 68IJK S'^W5IIK IIKs   A4C Cc                  aa	 V P                  4       oV P                  4       p V P                  P                  \        ^^4      o	V P                  P                  \        S4      pV P                  P                  VP
                  4      pVV	3R lp\        P                  ! VR7      pVP                  4        \        P
                  ! S	W#.\        P                  R7      w  rgV P                  \        S	V.4      V4       V P                  \        V.4      V4       \        P                  ! V4       SP                  4        VP                  4        VP                  4        R#   SP                  4        TP                  4        i ; i)   c                  H   < SP                  4        S P                  4        R # r   )r4   r(   )event1r6   s   r   wait_for_future18WaitTests.test_first_exception.<locals>.wait_for_future1L   s     

r   )targetr"   N)r2   r$   r%   r   r   r   	threadingThreadstartr   FIRST_EXCEPTIONr'   r(   r   join_threadr4   )
r)   event2r7   future3rE   tr=   r>   rD   r6   s
   &       @@r   test_first_exceptionWaitTests.test_first_exceptionC   s   ""$""$	mm**326Gmm**>6BGmm**6;;7G   (89AGGI 'g/ ' 7 7!9H S'7!34h?S'^W5((+JJLJJL JJLJJLs   DE# #"Fc                   V P                  4       pV P                  P                  \        ^^ 4      pV P                  P                  VP                  4      p \
        P                  ! \        \        \        W#.\
        P                  R7      w  rEV P                  \        \        \        V.4      V4       V P                  \        \        V.4      V4       VP                  4        VP                  4        R#   TP                  4        i ; ir0   )r2   r$   r%   divmodr   r   r	   r   r   rK   r'   r(   r4   )r)   r5   r6   r7   r=   r>   s   &     r   *test_first_exception_some_already_complete4WaitTests.test_first_exception_some_already_complete`   s    !!#--&&vr15--&&uzz2	 '&%2' !( 7 7!9H S"3"?")"+ ,-57 S"2G!<=wGIIK IIKs   A?C9 9Dc                   V P                  4       pV P                  P                  VP                  4      p \        P                  ! \
        V.\        P                  R 7      w  r4V P                  \        \
        .4      V4       V P                  \        V.4      V4       VP                  4        VP                  4        R#   TP                  4        i ; ir;   )
r2   r$   r%   r   r   r   rK   r'   r(   r4   r<   s   &    r   'test_first_exception_one_already_failed1WaitTests.test_first_exception_one_already_failedu   s    !!#--&&uzz2	 '&0!(!8!8!:H S"2!34h?S'^W5IIK IIKs   A*C Cc           	        V P                   P                  \        ^^ 4      pV P                   P                  \        ^^4      p\        P
                  ! \        \        \        VV.\        P                  R7      w  r4V P                  \        \        \        \        VV.4      V4       V P                  \        4       V4       R# )rB   r"   N)r$   r%   rS   r   r   r   r	   r   r   r&   r'   r(   )r)   r6   r7   r=   r>   s   &    r   test_all_completedWaitTests.test_all_completed   s    --&&vq!4--&&sAr2#LL".!	
 $113 	/;.%%	' ( *2		3
 	(r   c                   R pV P                  4       pV P                  P                  VP                  4      p \        P                  ! \
        \        \        V.V\        P                  R7      w  rEV P                  \        \
        \        \        .4      V4       V P                  \        V.4      V4       VP                  4        VP                  4        R#   TP                  4        i ; i)g?)timeoutr#   N)r2   r$   r%   r   r   r   r   r	   r&   r'   r(   r4   )r)   short_timeoutr5   r*   r=   r>   s   &     r   test_timeoutWaitTests.test_timeout   s    !!#%%ejj1	 '2%& * ' 5 5!7H S"?"2"3"5 6 &' S&]G4IIK IIKs   A?C C,r   N)__name__
__module____qualname____firstlineno__r-   r8   r?   rP   rT   rW   rZ   r_   __static_attributes____classdictcell____classdict__s   @r   r   r      s2     * ":*)& r   r   c                   &   a  ] tR t^t o R tRtV tR# )ThreadPoolWaitTestsc                  a \         P                  ! 4       oV3R  lp\        P                  ! 4       p\        P
                  ! R4        \        ^d4       Uu0 uF  q0P                  P                  V4      kK  	  ppSP                  4        \        P                  ! V\        P                  R7       \        P
                  ! V4       R# u upi   \        P
                  ! T4       i ; i)c                  (   < S P                  4        R # r   )r   )r5   s   r   future_func@ThreadPoolWaitTests.test_pending_calls_race.<locals>.future_func   s    JJLr   gư>r"   N)rH   Eventsysgetswitchintervalr   setswitchintervalranger$   r%   r(   r   r   r&   )r)   rm   oldswitchintervalifsr5   s   &    @r   test_pending_calls_race+ThreadPoolWaitTests.test_pending_calls_race   s     !	113!!$'	5=B3ZHZ--&&{3ZBHIIKLL)>)>?!!"34	 I !!"34s   	C #C	98C 	C C&r   N)ra   rb   rc   rd   rw   re   rf   rg   s   @r   rj   rj      s     5 5r   rj   )executor_mixinsc                      \        4        R # r   )r   r   r   r   setUpModuler{      s    Nr   __main__)rp   rH   unittest
concurrentr   testr   test.supportr   utilr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   rj   globalsr{   ra   mainr   r   r   <module>r      s    
     )M M M M,
U Up5/9l 5$ gi';'A'<'>? zMMO r   