forked from active-elastic-job/active-elastic-job
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a performance spec for start up time impact
- Loading branch information
Showing
6 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
require 'timeout' | ||
|
||
RAILS_START_UP_UPPER_BOUNDARY = 10 # in seconds | ||
describe "performance" do | ||
before(:all) do | ||
@rails_app = Helpers::RailsApp.new("#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}") | ||
end | ||
|
||
describe "rails start up time" do | ||
it "performs under #{RAILS_START_UP_UPPER_BOUNDARY} seconds" do | ||
begin | ||
Timeout::timeout(RAILS_START_UP_UPPER_BOUNDARY) do | ||
@rails_app.run_in_rails_app_root_dir do | ||
system("bundle exec rails runner \"puts 'hello world!'\" ") | ||
end | ||
end | ||
rescue Timeout::Error | ||
fail "Rails app has not started within #{RAILS_START_UP_UPPER_BOUNDARY} seconds" | ||
end | ||
end | ||
end | ||
end |