Esempio n. 1
0
 def init(self):
     if test_command == 'child_error_during_init':
         #Pretend we were actually doing something
         FunkyWebServer.parse_args_and_setup_logging()
         logging.info("Child about to fail")
         raise ValueError('I was told to fail')
     elif test_command == 'child_freeze_during_init':
         FunkyWebServer.parse_args_and_setup_logging()
         hold_gil(10*60)
     self.server = FunkyWebServer()
Esempio n. 2
0
 def init(self):
     if test_command == 'child_error_during_init':
         #Pretend we were actually doing something
         FunkyWebServer.parse_args_and_setup_logging()
         logging.info("Child about to fail")
         raise ValueError('I was told to fail')
     elif test_command == 'child_freeze_during_init':
         FunkyWebServer.parse_args_and_setup_logging()
         hold_gil(10 * 60)
     self.server = FunkyWebServer()
     signal.signal(signal.SIGINT, self.signal_handler)
Esempio n. 3
0
            f.write("Started: %s\n" % pid)

    _log_to_file('Starting up %r' % sys.argv)

    if len(sys.argv) >= 3 and sys.argv[1] == '--process_number' and sys.argv[2] == '2':
        _log_to_file('Trying to read command file')
        command_file = os.path.join(os.path.dirname(__file__), 'tmp', 'command.txt')
        if os.path.exists(command_file):
            with open(command_file, "r") as f:
                command = f.read()
            _log_to_file('Read command %s' % command)
            if command == 'child_exit_on_start':
                os._exit(25)
            elif command == 'child_freeze_on_start':
                from processfamily.test.FunkyWebServer import hold_gil
                hold_gil(10*60)
            elif command == 'child_error_on_start':
                import middle.child.syndrome
            elif command == 'child_crash_on_start':
                from processfamily.test.FunkyWebServer import crash
                crash()
            else:
                test_command = command

_log_to_file('importing traceback')
import traceback
def _traceback_str():
    exc_info = sys.exc_info()
    return "".join(traceback.format_exception(exc_info[0], exc_info[1], exc_info[2]))

try:
Esempio n. 4
0
    _log_to_file('Starting up %r' % sys.argv)

    if len(sys.argv
           ) >= 3 and sys.argv[1] == '--process_number' and sys.argv[2] == '2':
        _log_to_file('Trying to read command file')
        command_file = os.path.join(os.path.dirname(__file__), 'tmp',
                                    'command.txt')
        if os.path.exists(command_file):
            with open(command_file, "r") as f:
                command = f.read()
            _log_to_file('Read command %s' % command)
            if command == 'child_exit_on_start':
                os._exit(25)
            elif command == 'child_freeze_on_start':
                from processfamily.test.FunkyWebServer import hold_gil
                hold_gil(10 * 60)
            elif command == 'child_error_on_start':
                import middle.child.syndrome
            elif command == 'child_crash_on_start':
                from processfamily.test.FunkyWebServer import crash
                crash()
            else:
                test_command = command

_log_to_file('importing traceback')
import traceback


def _traceback_str():
    exc_info = sys.exc_info()
    return "".join(