Show More
@@ -396,33 +396,34 class JSController(TestController): | |||
|
396 | 396 | self.server_port = info['port'] |
|
397 | 397 | |
|
398 | 398 | def cleanup(self): |
|
399 | try: | |
|
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 | |
|
399 | if hasattr(self, 'server'): | |
|
409 | 400 | try: |
|
410 | print("Failed to terminate notebook server, killing it.", | |
|
411 | file=sys.stderr | |
|
412 | ) | |
|
413 | self.server.kill() | |
|
401 | self.server.terminate() | |
|
414 | 402 | except OSError: |
|
415 | 403 | # already dead |
|
416 | 404 | pass |
|
417 | # wait another 10s | |
|
418 | try: | |
|
419 | popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT) | |
|
420 | except TimeoutExpired: | |
|
421 | print("Notebook server still running (%s)" % self.server_info_file, | |
|
422 |
|
|
|
423 | ) | |
|
424 | ||
|
425 | self.stream_capturer.halt() | |
|
405 | # wait 10s for the server to shutdown | |
|
406 | try: | |
|
407 | popen_wait(self.server, NOTEBOOK_SHUTDOWN_TIMEOUT) | |
|
408 | except TimeoutExpired: | |
|
409 | # server didn't terminate, kill it | |
|
410 | try: | |
|
411 | print("Failed to terminate notebook server, killing it.", | |
|
412 | file=sys.stderr | |
|
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 | 427 | TestController.cleanup(self) |
|
427 | 428 | |
|
428 | 429 |
General Comments 0
You need to be logged in to leave comments.
Login now