@@ -45,15 +45,15 @@ async def test_aio_timeout_generator(
45
45
@pytest .mark .parametrize (
46
46
'timeout,interval,interval_multiplier,maximum_interval,iterable,result' ,
47
47
[
48
- (0.01 , 0.006 , 0.5 , 0.01 , 'abc' , 'c' ),
49
- (0.01 , 0.007 , 0.5 , 0.01 , itertools .count , 2 ),
50
- (0.01 , 0.007 , 0.5 , 0.01 , itertools .count (), 2 ),
51
- (0.01 , 0.006 , 1.0 , None , 'abc' , 'c' ),
48
+ (0.1 , 0.06 , 0.5 , 0.1 , 'abc' , 'c' ),
49
+ (0.1 , 0.07 , 0.5 , 0.1 , itertools .count , 2 ),
50
+ (0.1 , 0.07 , 0.5 , 0.1 , itertools .count (), 2 ),
51
+ (0.1 , 0.06 , 1.0 , None , 'abc' , 'c' ),
52
52
(
53
- timedelta (seconds = 0.01 ),
54
- timedelta (seconds = 0.006 ),
53
+ timedelta (seconds = 0.1 ),
54
+ timedelta (seconds = 0.06 ),
55
55
2.0 ,
56
- timedelta (seconds = 0.01 ),
56
+ timedelta (seconds = 0.1 ),
57
57
itertools .count ,
58
58
2 ,
59
59
),
@@ -91,28 +91,28 @@ async def test_aio_generator_timeout_detector() -> None:
91
91
92
92
async def generator () -> types .AsyncGenerator [int , None ]:
93
93
for i in range (10 ):
94
- await asyncio .sleep (i / 100 .0 )
94
+ await asyncio .sleep (i / 20 .0 )
95
95
yield i
96
96
97
97
detector = python_utils .aio_generator_timeout_detector
98
98
# Test regular timeout with reraise
99
99
with pytest .raises (asyncio .TimeoutError ):
100
- async for i in detector (generator (), 0.05 ):
100
+ async for i in detector (generator (), 0.25 ):
101
101
pass
102
102
103
103
# Test regular timeout with clean exit
104
- async for i in detector (generator (), 0.05 , on_timeout = None ):
104
+ async for i in detector (generator (), 0.25 , on_timeout = None ):
105
105
pass
106
106
107
107
assert i == 4
108
108
109
109
# Test total timeout with reraise
110
110
with pytest .raises (asyncio .TimeoutError ):
111
- async for i in detector (generator (), total_timeout = 0.1 ):
111
+ async for i in detector (generator (), total_timeout = 0.5 ):
112
112
pass
113
113
114
114
# Test total timeout with clean exit
115
- async for i in detector (generator (), total_timeout = 0.1 , on_timeout = None ):
115
+ async for i in detector (generator (), total_timeout = 0.5 , on_timeout = None ):
116
116
pass
117
117
118
118
assert i == 4
0 commit comments