
    ih                     f   d dl mZmZmZ d dlZd dlZd dlZddlmZ ddlm	Z	  G d de
      Z G d d	ej                        Z G d
 de      Z G d de      Z G d de      Zd ZeZeZeZej*                  sej,                  r"ej.                  rd Zd Zej0                  reZeZe
efdZe
fdZy)    )absolute_importprint_functiondivisionN   )sysinfo)sixc                       e Zd ZdZy)FlakyAssertionErrorz2Re-raised so that we know it's a known-flaky test.N__name__
__module____qualname____doc__     R/var/www/html/dev/engine/venv/lib/python3.12/site-packages/gevent/testing/flaky.pyr
   r
      s    8r   r
   c                       e Zd ZdZy)	FlakyTestz
    A unittest exception that causes the test to be skipped when raised.

    Use this carefully, it is a code smell and indicates an undebugged problem.
    Nr   r   r   r   r   r   #   s    r   r   c                       e Zd ZdZy)FlakyTestRaceConditionzP
    Use this when the flaky test is definitely caused by a race condition.
    Nr   r   r   r   r   r   *       r   r   c                       e Zd ZdZy)FlakyTestTimeoutzY
    Use this when the flaky test is definitely caused by an
    unexpected timeout.
    Nr   r   r   r   r   r   /   s    r   r   c                       e Zd ZdZy)FlakyTestCrashesz3
    Use this when the test sometimes crashes.
    Nr   r   r   r   r   r   5   r   r   r   c                      t        j                  t        t        t        j                         d         t        j                         d          y Nr      )r   reraiser
   sysexc_infor   r   r   reraiseFlakyTestRaceConditionr"   :   s2    KK##CLLN1$56q!#r   c                      t        t        j                         d         } t        j                  t
        t        |       t        j                         d          y r   )strr    r!   r   r   r   msgs    r   r"   r"   E   s>     #,,.#$**3/LLN1%	'r   c                      t        t        j                         d         } t        j                  t
        t        |       t        j                         d          y r   )r$   r    r!   r   r   r   r%   s    r   reraiseFlakyTestTimeoutr(   Y   s<    #,,.#$$$S)LLN1%	'r   c                       fd}|S )Nc                 H     t        j                          fd       }|S )Nc                  6    	  |   y # $ r
          Y y w xY w)Nr   )args_funcexc_kindfs    r   mz2reraises_flaky_timeout.<locals>.wrapper.<locals>.mg   s#    4 s   	 )	functoolswraps)r/   r0   r-   r.   s   ` r   wrapperz'reraises_flaky_timeout.<locals>.wrapperf   s%    			 
	
 r   r   )r.   r-   r3   s   `` r   reraises_flaky_timeoutr4   d   s     Nr   c                 $    t        | t              S )N)r-   )r4   r"   )r.   s    r   reraises_flaky_race_conditionr6   q   s    !(2OPPr   )
__future__r   r   r   r    r1   unittest r   r   AssertionErrorr
   SkipTestr   r   r   r   r"   r(   "reraiseFlakyTestRaceConditionLibuvreraiseFlakyTestTimeoutLibuvRUNNING_ON_CIPYPYWINLIBUVr4   r6   r   r   r   <module>rB      s   ( A @ 
    9. 9!! Y 
y y 
#
 8 %B "< 
W\\gkk'(' }}-J*'>$ %3:Q  ,: Qr   