Changeset 1810
- Timestamp:
- 10/29/07 16:24:31
- Files:
-
- trunk/cherrypy/restsrv/wspbus.py (modified) (1 diff)
- trunk/cherrypy/test/test_states.py (modified) (1 diff)
- trunk/cherrypy/test/test_states_demo.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/restsrv/wspbus.py
r1759 r1810 150 150 self.state = states.STARTING 151 151 self.log('Bus starting') 152 self.publish('start') 152 try: 153 self.publish('start') 154 except: 155 try: 156 self.stop() 157 except: 158 # Any stop errors will be logged inside publish(). 159 pass 160 raise 153 161 self.state = states.STARTED 154 162 trunk/cherrypy/test/test_states.py
r1755 r1810 307 307 if x.args != (10, 'No child processes'): 308 308 raise 309 310 def test_5_Start_Error(self): 311 if not self.server_class: 312 print "skipped (no server) ", 313 return 314 315 # Start the demo script in a new process 316 demoscript = os.path.join(os.getcwd(), os.path.dirname(__file__), 317 "test_states_demo.py") 318 host = cherrypy.server.socket_host 319 port = cherrypy.server.socket_port 320 321 # If a process errors during start, it should stop the engine 322 # and exit with a non-zero exit code. 323 args = [sys.executable, demoscript, host, str(port), '-starterror'] 324 if self.scheme == "https": 325 args.append('-ssl') 326 exit_code = os.spawnl(os.P_WAIT, sys.executable, *args) 327 if exit_code == 0: 328 self.fail("Process failed to return nonzero exit code.") 309 329 310 330 trunk/cherrypy/test/test_states_demo.py
r1756 r1810 63 63 cherrypy.engine.subscribe('start', cherrypy.server.quickstart) 64 64 65 if '-starterror' in sys.argv[3:]: 66 cherrypy.engine.subscribe('start', lambda: 1/0) 67 65 68 # This is in a special order for a reason: 66 69 # it allows test_states to wait_for_occupied_port

