Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
fix crash, so it kill the current process
Browse files Browse the repository at this point in the history
Change-Id: I9c55d6d8cb5ab77b1a20266bb00ae96a433555a7
  • Loading branch information
fribeiro committed Jul 19, 2011
1 parent d200d48 commit fe54599
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions apps/app_node_service/main.js
Expand Up @@ -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();
Expand Down
Expand Up @@ -9,7 +9,7 @@ def env
end

def crash
raise "It should crash"
Process.kill("KILL", Process.pid)
end

def service
Expand Down
2 changes: 1 addition & 1 deletion apps/app_sinatra_service/main.rb
Expand Up @@ -15,7 +15,7 @@
end

get '/crash' do
raise "This should crash!!!!"
Process.kill("KILL", Process.pid)
end

get '/service/redis/:key' do
Expand Down
Binary file modified apps/app_spring_service/app_spring_service.war
Binary file not shown.
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/appcloud_steps.rb
Expand Up @@ -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

Expand Down

0 comments on commit fe54599

Please sign in to comment.