diff --git a/apps/app_node_service/main.js b/apps/app_node_service/main.js index 0b7d52d..fefd82f 100644 --- a/apps/app_node_service/main.js +++ b/apps/app_node_service/main.js @@ -27,8 +27,7 @@ var app = [ res.respond('hello from node'); }], [get(/^\/crash$/), function(req, res, name) { - res.writeHead(500, { 'content-type': 'text/plain' }); - res.end(); + process.kill(process.pid, 'SIGKILL'); }], [get(/^\/service\/redis\/(\w+)$/), function(req, res, key) { var client = redis_services(); diff --git a/apps/app_rails_service/app/controllers/service_controller.rb b/apps/app_rails_service/app/controllers/service_controller.rb index 7e2eec4..e0e2110 100644 --- a/apps/app_rails_service/app/controllers/service_controller.rb +++ b/apps/app_rails_service/app/controllers/service_controller.rb @@ -9,7 +9,7 @@ def env end def crash - raise "It should crash" + Process.kill("KILL", Process.pid) end def service diff --git a/apps/app_sinatra_service/main.rb b/apps/app_sinatra_service/main.rb index 07e1e5c..68706dc 100644 --- a/apps/app_sinatra_service/main.rb +++ b/apps/app_sinatra_service/main.rb @@ -15,7 +15,7 @@ end get '/crash' do - raise "This should crash!!!!" + Process.kill("KILL", Process.pid) end get '/service/redis/:key' do diff --git a/apps/app_spring_service/app_spring_service.war b/apps/app_spring_service/app_spring_service.war index e763d6a..7a85a28 100644 Binary files a/apps/app_spring_service/app_spring_service.war and b/apps/app_spring_service/app_spring_service.war differ diff --git a/apps/app_spring_service/src/main/java/org/cloudfoundry/canonical/apps/ServiceController.java b/apps/app_spring_service/src/main/java/org/cloudfoundry/canonical/apps/ServiceController.java index ce587be..f49cef0 100644 --- a/apps/app_spring_service/src/main/java/org/cloudfoundry/canonical/apps/ServiceController.java +++ b/apps/app_spring_service/src/main/java/org/cloudfoundry/canonical/apps/ServiceController.java @@ -53,8 +53,11 @@ public void hello(HttpServletResponse response) throws IOException { } @RequestMapping(value = "/crash", method = RequestMethod.GET) - public String crash() throws Exception { - throw new Exception(); + public void crash(HttpServletResponse response) throws IOException{ + PrintWriter out = response.getWriter(); +// Thread.currentThread().interrupt(); + System.exit(0); + out.println("it should not get here"); } @RequestMapping(value = "/service/mongo/{key}", method = RequestMethod.POST) diff --git a/features/step_definitions/appcloud_steps.rb b/features/step_definitions/appcloud_steps.rb index 2507cb9..57c0008 100644 --- a/features/step_definitions/appcloud_steps.rb +++ b/features/step_definitions/appcloud_steps.rb @@ -502,8 +502,8 @@ Then /^I should be able to access crash and it should crash$/ do contents = get_app_contents @app, 'crash' contents.should_not == nil - contents.body_str.should_not == nil - contents.response_code.should == 500 + contents.response_code.should >= 500 + contents.response_code.should < 600 contents.close end