File tree Expand file tree Collapse file tree 1 file changed +3
-27
lines changed
Expand file tree Collapse file tree 1 file changed +3
-27
lines changed Original file line number Diff line number Diff line change 2121def test_post_to_a_flow (show_pbar , conn_config , batch_size ):
2222 from jina import Flow
2323
24- def start_flow (stop_event , ** kwargs ):
25- """start a blocking Flow."""
26- with Flow (** kwargs ) as f :
27- f .block (stop_event = stop_event )
28- print ('bye' )
29-
30- e = multiprocessing .Event () # create new Event
31-
3224 p = random_port ()
33- t = multiprocessing .Process (
34- name = 'Blocked-Flow' ,
35- target = start_flow ,
36- args = (e ,),
37- kwargs = {** conn_config [0 ], 'port' : p },
38- )
39- t .start ()
40-
41- time .sleep (3 )
42-
4325 da = DocumentArray .empty (100 )
44- try :
26+ with Flow ( ** { ** conn_config [ 0 ], 'port' : p }) :
4527 da .post (conn_config [1 ].replace ('$port' , str (p )), batch_size = batch_size )
46- except :
47- raise
48- finally :
49- e .set ()
50- t .join ()
51- time .sleep (1 )
5228
5329
5430@pytest .mark .parametrize (
5531 'hub_uri' ,
5632 [
5733 'jinahub://Hello' ,
5834 'jinahub+sandbox://Hello' ,
59- #'jinahub+docker://Hello', this somehow does not work on GH workflow
35+ # 'jinahub+docker://Hello', this somehow does not work on GH workflow
6036 ],
6137)
6238def test_post_with_jinahub (hub_uri ):
@@ -95,7 +71,7 @@ def start_flow(stop_event, **kwargs):
9571 )
9672 t .start ()
9773
98- time .sleep (1 )
74+ time .sleep (5 )
9975 N = 100
10076 da = DocumentArray .empty (N )
10177 try :
You can’t perform that action at this time.
0 commit comments