@@ -66,7 +66,7 @@ def test_no_dashboard(loop):
6666def test_dashboard (loop ):
6767 pytest .importorskip ("bokeh" )
6868
69- with popen (["dask-scheduler" ], flush_output = False ) as proc :
69+ with popen (["dask-scheduler" ], capture_output = True ) as proc :
7070 line = wait_for_log_line (b"dashboard at" , proc .stdout )
7171 dashboard_port = int (line .decode ().split (":" )[- 1 ].strip ())
7272
@@ -99,24 +99,22 @@ def test_dashboard_non_standard_ports(loop):
9999 pytest .importorskip ("bokeh" )
100100
101101 with popen (
102- ["dask-scheduler" , "--port" , "23448" , "--dashboard-address" , ":24832" ],
103- flush_output = False ,
102+ ["dask-scheduler" , "--port" , "3448" , "--dashboard-address" , ":4832" ]
104103 ) as proc :
105- line = wait_for_log_line (b"dashboard at" , proc .stdout )
106- with Client ("127.0.0.1:23448" , loop = loop ) as c :
104+ with Client ("127.0.0.1:3448" , loop = loop ) as c :
107105 pass
108106
109107 start = time ()
110108 while True :
111109 try :
112- response = requests .get ("http://localhost:24832 /status/" )
110+ response = requests .get ("http://localhost:4832 /status/" )
113111 assert response .ok
114112 break
115113 except Exception :
116114 sleep (0.1 )
117115 assert time () < start + 20
118116 with pytest .raises (Exception ):
119- requests .get ("http://localhost:24832 /status/" )
117+ requests .get ("http://localhost:4832 /status/" )
120118
121119
122120@pytest .mark .skipif (not LINUX , reason = "Need 127.0.0.2 to mean localhost" )
@@ -209,10 +207,8 @@ def check_pidfile(proc, pidfile):
209207def test_scheduler_port_zero (loop ):
210208 with tmpfile () as fn :
211209 with popen (
212- ["dask-scheduler" , "--no-dashboard" , "--scheduler-file" , fn , "--port" , "0" ],
213- flush_output = False ,
214- ) as proc :
215- line = wait_for_log_line (b"dashboard at" , proc .stdout )
210+ ["dask-scheduler" , "--no-dashboard" , "--scheduler-file" , fn , "--port" , "0" ]
211+ ):
216212 with Client (scheduler_file = fn , loop = loop ) as c :
217213 assert c .scheduler .port
218214 assert c .scheduler .port != 8786
@@ -222,7 +218,7 @@ def test_dashboard_port_zero(loop):
222218 pytest .importorskip ("bokeh" )
223219 with popen (
224220 ["dask-scheduler" , "--dashboard-address" , ":0" ],
225- flush_output = False ,
221+ capture_output = True ,
226222 ) as proc :
227223 line = wait_for_log_line (b"dashboard at" , proc .stdout )
228224 dashboard_port = int (line .decode ().split (":" )[- 1 ].strip ())
0 commit comments