##// END OF EJS Templates
Merge pull request #7709 from SylvainCorlay/iptest...
Thomas Kluyver -
r20368:28a0fc76 merge
parent child Browse files
Show More
@@ -396,33 +396,34 class JSController(TestController):
396 self.server_port = info['port']
396 self.server_port = info['port']
397
397
398 def cleanup(self):
398 def cleanup(self):
399 try:
399 if hasattr(self, 'server'):
400 self.server.terminate()
401 except OSError:
402 # already dead
403 pass
404 # wait 10s for the server to shutdown
405 try:
406 popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT)
407 except TimeoutExpired:
408 # server didn't terminate, kill it
409 try:
400 try:
410 print("Failed to terminate notebook server, killing it.",
401 self.server.terminate()
411 file=sys.stderr
412 )
413 self.server.kill()
414 except OSError:
402 except OSError:
415 # already dead
403 # already dead
416 pass
404 pass
417 # wait another 10s
405 # wait 10s for the server to shutdown
418 try:
406 try:
419 popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT)
407 popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT)
420 except TimeoutExpired:
408 except TimeoutExpired:
421 print("Notebook server still running (%s)" % self.server_info_file,
409 # server didn't terminate, kill it
422 file=sys.stderr
410 try:
423 )
411 print("Failed to terminate notebook server, killing it.",
424
412 file=sys.stderr
425 self.stream_capturer.halt()
413 )
414 self.server.kill()
415 except OSError:
416 # already dead
417 pass
418 # wait another 10s
419 try:
420 popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT)
421 except TimeoutExpired:
422 print("Notebook server still running (%s)" % self.server_info_file,
423 file=sys.stderr
424 )
425
426 self.stream_capturer.halt()
426 TestController.cleanup(self)
427 TestController.cleanup(self)
427
428
428
429
General Comments 0
You need to be logged in to leave comments. Login now