File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
tools/wptrunner/wptrunner/browsers Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 11# mypy: allow-untyped-defs
22
3- from http .client import HTTPConnection
3+ from http .client import HTTPConnection , ResponseNotReady
44import os
55import tempfile
66import time
@@ -147,11 +147,19 @@ def stop(self, force=False):
147147 conn = HTTPConnection (self .host , self .port )
148148 while self .is_alive ():
149149 self .logger .info ("Trying to shut down gracefully by extension command" )
150-
151- conn .request ("DELETE" , "/session/dummy-session-id/servo/shutdown" )
152- res = conn .getresponse ()
153- self .logger .info (f"Got response status for shutdown command: { res .status } " )
154-
150+ while True :
151+ try :
152+ conn .request ("DELETE" , "/session/dummy-session-id/servo/shutdown" )
153+ res = conn .getresponse ()
154+ self .logger .info (f"Got response status for shutdown command: { res .status } " )
155+ except ResponseNotReady :
156+ self .logger .info (f"Shutdown request not sent yet, retrying..." )
157+ continue
158+ except Exception as e :
159+ self .logger .info (f"Servo browser already shut down: { e } " )
160+ return
161+ # Successfully sent the shutdown command
162+ break
155163 time .sleep (0.1 )
156164
157165 def find_wpt_prefs (self , logger ):
You can’t perform that action at this time.
0 commit comments