Changeset 1815
- Timestamp:
- 11/02/07 17:23:02
- Files:
-
- trunk/cherrypy/test/test_states.py (modified) (1 diff)
- trunk/cherrypy/test/test_states_demo.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test_states.py
r1810 r1815 328 328 self.fail("Process failed to return nonzero exit code.") 329 329 330 def test_6_Start_Error_With_Daemonize(self): 331 if not self.server_class: 332 print "skipped (no server) ", 333 return 334 335 # Start the demo script in a new process 336 demoscript = os.path.join(os.getcwd(), os.path.dirname(__file__), 337 "test_states_demo.py") 338 host = cherrypy.server.socket_host 339 port = cherrypy.server.socket_port 340 341 # If a process errors during start, it should stop the engine 342 # and exit with a non-zero exit code, even if we daemonize soon 343 # thereafter. 344 args = [sys.executable, demoscript, host, str(port), '-starterror', '-daemonize'] 345 if self.scheme == "https": 346 args.append('-ssl') 347 exit_code = os.spawnl(os.P_WAIT, sys.executable, *args) 348 if exit_code == 0: 349 self.fail("Process failed to return nonzero exit code.") 350 time.sleep(2) # Wait for the daemonized process to exit. 351 330 352 331 353 class DaemonizeTest(helper.CPWebCase): trunk/cherrypy/test/test_states_demo.py
r1810 r1815 37 37 "server.socket_port": int(sys.argv[2]), 38 38 "log.screen": False, 39 "log.error_file": os.path.join(thisdir, 'test_states_demo.error.log'), 39 40 } 40 41 … … 61 62 plugins.PIDFile(cherrypy.engine, PID_file_path).subscribe() 62 63 63 cherrypy.engine.subscribe('start', cherrypy.server.quickstart )64 cherrypy.engine.subscribe('start', cherrypy.server.quickstart, priority=75) 64 65 65 66 if '-starterror' in sys.argv[3:]: 66 cherrypy.engine.subscribe('start', lambda: 1/0 )67 cherrypy.engine.subscribe('start', lambda: 1/0, priority=6) 67 68 68 69 # This is in a special order for a reason:

