Skip to content

Commit

Permalink
Put back the memory checks. Works on fedora at least :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
gja committed Oct 27, 2011
1 parent 6842397 commit a8cdc51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/secure/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Secure
VERSION = "1.1.2"
VERSION = "1.1.3"
end
12 changes: 6 additions & 6 deletions spec/secure/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,24 @@ module Secure
while true; end
end
response.should_not be_success
response.error.should be_a(Secure::TimeoutError)
response.error.should be_a(TimeoutError)
end

it "kills a process using too much cpu" do
response = Runner.new(:limit_cpu => 1).run do
while true; end
end
response.should_not be_success
response.error.should be_a(Secure::ChildKilledError)
response.error.should be_a(ChildKilledError)
end

it "should kill a process with too much memory on linux" do
it "should kill a process with too much memory" do
except_on_OSX
response = Runner.new(:limit_memory => 10 * 1024).run do
'a' * 10 * 1024
response = Runner.new(:limit_memory => 1024 * 1024).run do
'a' * 1024 * 1024
end
response.should_not be_success
response.error.should be_a(NoMemoryError)
response.error.should be_a(ChildKilledError)
end

it "kills a process trying to fork" do
Expand Down

0 comments on commit a8cdc51

Please sign in to comment.