@@ -64,10 +64,10 @@ async def docs_with_params(
64
64
@pytest .mark .parametrize ('replicas' , [1 , 3 ])
65
65
@pytest .mark .parametrize ('include_gateway' , [True , False ])
66
66
@pytest .mark .parametrize ('cors' , [True , False ])
67
- @pytest .mark .parametrize ('protocols' , [['grpc' , 'http' ], [ 'grpc' ], ['http' ]])
68
- @pytest .mark .parametrize ('init_sleep_time' , [0 , 0.5 , 5 ])
67
+ @pytest .mark .parametrize ('protocols' , [['grpc' ], ['http' ]])
68
+ @pytest .mark .parametrize ('init_sleep_time' , [0 , 5 ])
69
69
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
70
- def test_slow_load_executor (
70
+ def test_slow_load_executor_docarray_v2 (
71
71
replicas , include_gateway , protocols , init_sleep_time , cors
72
72
):
73
73
if replicas > 1 and not include_gateway :
@@ -87,21 +87,21 @@ def test_slow_load_executor(
87
87
c = Client (protocol = protocol , port = port )
88
88
res = c .post (
89
89
on = '/foo' ,
90
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
90
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
91
91
request_size = 1 ,
92
92
return_type = DocList [OutputTestDoc ],
93
93
)
94
- assert len (res ) == 10
94
+ assert len (res ) == 100
95
95
assert all (['foo' in doc .text for doc in res ])
96
96
different_pids = set ([doc .tags ['pid' ] for doc in res ])
97
97
assert len (different_pids ) == replicas
98
98
res = c .post (
99
99
on = '/bar' ,
100
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
100
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
101
101
request_size = 1 ,
102
102
return_type = DocList [OutputTestDoc ],
103
103
)
104
- assert len (res ) == 10
104
+ assert len (res ) == 100
105
105
assert all (['bar' in doc .text for doc in res ])
106
106
assert all ([not doc .flag for doc in res ])
107
107
different_pids = set ([doc .tags ['pid' ] for doc in res ])
@@ -111,9 +111,9 @@ def test_slow_load_executor(
111
111
@pytest .mark .parametrize ('replicas' , [1 , 3 ])
112
112
@pytest .mark .parametrize ('include_gateway' , [True , False ])
113
113
@pytest .mark .parametrize ('protocol' , ['grpc' , 'http' ])
114
- @pytest .mark .parametrize ('init_sleep_time' , [0 , 0.5 , 5 ])
114
+ @pytest .mark .parametrize ('init_sleep_time' , [0 , 5 ])
115
115
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
116
- def test_post_from_deployment (replicas , include_gateway , protocol , init_sleep_time ):
116
+ def test_post_from_deployment_docarray_v2 (replicas , include_gateway , protocol , init_sleep_time ):
117
117
if replicas > 1 and not include_gateway :
118
118
return
119
119
d = Deployment (
@@ -126,7 +126,7 @@ def test_post_from_deployment(replicas, include_gateway, protocol, init_sleep_ti
126
126
with d :
127
127
res = d .post (
128
128
on = '/foo' ,
129
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
129
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
130
130
request_size = 1 ,
131
131
return_type = DocList [OutputTestDoc ],
132
132
)
@@ -135,11 +135,11 @@ def test_post_from_deployment(replicas, include_gateway, protocol, init_sleep_ti
135
135
assert len (different_pids ) == replicas
136
136
res = d .post (
137
137
on = '/bar' ,
138
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
138
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
139
139
request_size = 1 ,
140
140
return_type = DocList [OutputTestDoc ],
141
141
)
142
- assert len (res ) == 10
142
+ assert len (res ) == 100
143
143
assert all (['bar' in doc .text for doc in res ])
144
144
different_pids = set ([doc .tags ['pid' ] for doc in res ])
145
145
assert len (different_pids ) == replicas
@@ -149,7 +149,7 @@ def test_post_from_deployment(replicas, include_gateway, protocol, init_sleep_ti
149
149
@pytest .mark .parametrize ('include_gateway' , [True , False ])
150
150
@pytest .mark .parametrize ('protocols' , [['http' ], ['grpc' , 'http' ]])
151
151
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
152
- def test_base_executor (replicas , include_gateway , protocols ):
152
+ def test_base_executor_docarray_v2 (replicas , include_gateway , protocols ):
153
153
if replicas > 1 and not include_gateway :
154
154
return
155
155
ports = [random_port () for _ in range (len (protocols ))]
@@ -171,12 +171,12 @@ def test_base_executor(replicas, include_gateway, protocols):
171
171
assert len (res ) == 10
172
172
173
173
174
- @pytest .mark .parametrize ('replicas' , [1 , 3 ])
175
- @pytest .mark .parametrize ('include_gateway' , [True , False ])
176
- @pytest .mark .parametrize ('protocols' , [['http' ], [ ' grpc' , 'http' ]])
177
- @pytest .mark .parametrize ('init_sleep_time' , [0 , 0.5 , 5 ])
174
+ @pytest .mark .parametrize ('replicas' , [1 ])
175
+ @pytest .mark .parametrize ('include_gateway' , [False ])
176
+ @pytest .mark .parametrize ('protocols' , [['grpc' , 'http' ]])
177
+ @pytest .mark .parametrize ('init_sleep_time' , [0 , 5 ])
178
178
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
179
- def test_return_parameters (replicas , include_gateway , protocols , init_sleep_time ):
179
+ def test_return_parameters_docarray_v2 (replicas , include_gateway , protocols , init_sleep_time ):
180
180
if replicas > 1 and not include_gateway :
181
181
return
182
182
ports = [random_port () for _ in range (len (protocols ))]
@@ -193,12 +193,12 @@ def test_return_parameters(replicas, include_gateway, protocols, init_sleep_time
193
193
c = Client (protocol = protocol , port = port )
194
194
res = c .post (
195
195
on = '/parameters' ,
196
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
196
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
197
197
request_size = 1 ,
198
198
return_type = DocList [OutputTestDoc ],
199
199
return_responses = True ,
200
200
)
201
- assert len (res ) == 10
201
+ assert len (res ) == 100
202
202
assert all (
203
203
['__results__' in response .parameters .keys () for response in res ]
204
204
)
@@ -211,20 +211,20 @@ def test_return_parameters(replicas, include_gateway, protocols, init_sleep_time
211
211
assert len (different_pids ) == replicas
212
212
res = c .post (
213
213
on = '/docsparams' ,
214
- inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (10 )]),
214
+ inputs = DocList [InputTestDoc ]([InputTestDoc () for _ in range (100 )]),
215
215
parameters = {'key' : 'value' },
216
216
request_size = 1 ,
217
217
return_type = DocList [OutputTestDoc ],
218
218
)
219
- assert len (res ) == 10
219
+ assert len (res ) == 100
220
220
assert all ([doc .text == 'value' for doc in res ])
221
221
222
222
223
223
@pytest .mark .parametrize ('replicas' , [1 , 3 ])
224
224
@pytest .mark .parametrize ('include_gateway' , [True , False ])
225
225
@pytest .mark .parametrize ('protocols' , [['http' ], ['grpc' , 'http' ]])
226
226
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
227
- def test_invalid_protocols_with_shards (replicas , include_gateway , protocols ):
227
+ def test_invalid_protocols_with_shards_docarray_v2 (replicas , include_gateway , protocols ):
228
228
if replicas > 1 and not include_gateway :
229
229
return
230
230
with pytest .raises (RuntimeError ):
@@ -242,7 +242,7 @@ def test_invalid_protocols_with_shards(replicas, include_gateway, protocols):
242
242
@pytest .mark .parametrize ('include_gateway' , [True , False ])
243
243
@pytest .mark .parametrize ('protocols' , [['websocket' ], ['grpc' , 'websocket' ]])
244
244
@pytest .mark .skipif (not docarray_v2 , reason = 'tests support for docarray>=0.30' )
245
- def test_invalid_websocket_protocol (replicas , include_gateway , protocols ):
245
+ def test_invalid_websocket_protocol_docarray_v2 (replicas , include_gateway , protocols ):
246
246
if replicas > 1 and not include_gateway :
247
247
return
248
248
with pytest .raises (RuntimeError ):
0 commit comments