Example #1
0
 def _watchPidWrapper():
     "PID attachment monitor"
     try:
         if utils.isProcessRunning(source_pid):
             Timer(1, _watchPidWrapper).start()
         else:
             _logger.warning("Process %d is not running anymore", source_pid)
             utils.terminateProcess(target_pid)
     except (TypeError, AttributeError):  # pragma: no cover
         return
Example #2
0
 def _watchPidWrapper():
     "PID attachment monitor"
     try:
         if utils.isProcessRunning(source_pid):
             Timer(1, _watchPidWrapper).start()
         else:
             _logger.warning("Process %d is not running anymore",
                             source_pid)
             utils.terminateProcess(target_pid)
     except (TypeError, AttributeError):  # pragma: no cover
         return
Example #3
0
    def test():
        startCodeCheckerServer()
        # Ensure the server is active
        reply = requests.post(it._url + '/get_diagnose_info',
                              data={'project_file' : 'some_project'})
        it.assertTrue(reply.ok)

        # Send a request to the shutdown addr
        with it.assertRaises(requests.ConnectionError):
            reply = requests.post(it._url + '/shutdown')

        it._server.terminate()
        utils.terminateProcess(it._server.pid)
Example #4
0
def shutdownServer():
    """
    Terminates the current process to shutdown the server
    """
    _logger.info("Shutting down server")
    utils.terminateProcess(os.getpid())
Example #5
0
 def teardown():
     it._server.terminate()
     utils.terminateProcess(it._server.pid)
Example #6
0
def shutdownServer():
    """
    Terminates the current process to shutdown the server
    """
    _logger.info("Shutting down server")
    utils.terminateProcess(os.getpid())