Skip to content

Commit

Permalink
Removed untested code in forceful termination of server process.
Browse files Browse the repository at this point in the history
In tests, the removed code lines are never executed.
In practice, they are unlikely to have any effect.
  • Loading branch information
john-hen committed May 3, 2021
1 parent 435959e commit 1e2f11d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions mph/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,5 @@ def stop(self, timeout=10):
logger.info(f'Server on port {self.port} has stopped.')
except TimeoutExpired:
logger.warning('Server did not shut down within time-out period.')
logger.info('Forcefully terminating external server process.')
logger.info('Trying to forcefully terminate server process.')
self.process.kill()
t0 = now()
while self.running():
if not self.running():
break
if now() - t0 > timeout:
error = 'Forceful shutdown failed within time-out period.'
logger.error(error)
raise TimeoutError(error) from None
sleep(0.1)
logger.info('Server process has been forcefully terminated.')
4 changes: 2 additions & 2 deletions tests/coverage.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1e2f11d

Please sign in to comment.