Skip to content

Commit

Permalink
New trial for better testing stability on Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Circle CI Automated Builder committed Mar 21, 2016
1 parent 67c5fa6 commit d2ad255
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ AllCops:
- 'tmp/**/*'
TargetRubyVersion: 2.2

Metrics/AbcSize:
Enabled: false

Metrics/LineLength:
Enabled: false
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/100_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
if ENV['CIRCLECI']
@container_db.kill signal: 'SIGKILL' unless @container_db.nil?
else
@container_db.kill signal: 'SIGKILL' unless @container_db.nil?
@container_db.remove force: true, v: true unless @container_db.nil?
end
end
Expand Down Expand Up @@ -54,6 +55,7 @@
if ENV['CIRCLECI']
@container_db.kill signal: 'SIGKILL' unless @container_db.nil?
else
@container_db.kill signal: 'SIGKILL' unless @container_db.nil?
@container_db.remove force: true, v: true unless @container_db.nil?
end
end
Expand Down Expand Up @@ -84,6 +86,7 @@
if ENV['CIRCLECI']
@container_proxy.kill signal: 'SIGKILL' unless @container_proxy.nil?
else
@container_proxy.kill signal: 'SIGKILL' unless @container_proxy.nil?
@container_proxy.remove force: true, v: true unless @container_proxy.nil?
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
REGEX_WARN = /WARNING|WARN/
REGEX_ERROR = /ERROR|ERR/
REGEX_SEVERE = /SEVERE|FATAL/
REGEX_STARTUP = /Server startup in \d+ ms/
REGEX_STARTUP = /Server startup in (\d+) ms/
REGEX_FILTER = Regexp.compile Regexp.union [
/Bundle\ org\.springframework\.osgi\.extender\ \[.*\]\ EventDispatcher:\ Error\ during\ dispatch\.\ \(java\.lang\.NullPointerException\)/,
/The\ executor\ associated\ with\ thread\ pool\ \[http\-bio\-8090\]\ has\ not\ fully\ shutdown\.\ Some\ application\ threads\ may\ still\ be\ running\./,
Expand Down
9 changes: 7 additions & 2 deletions spec/support/helpers/docker_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ def wait_for_output(regex)
thread = Thread.new do
timeout(Docker::DSL.timeout) do
Thread.handle_interrupt(TimeoutError => :on_blocking) do
streaming_logs stdout: true, stderr: true, tail: 'all', follow: true do |_, chunk|
Thread.exit if chunk =~ regex
streaming_logs stdout: true, stderr: true, follow: true do |stream, chunk|
puts "[#{stream}] #{chunk}" if ENV['TRAVIS']
if chunk =~ regex
Thread.current[:chunk] = chunk
Thread.exit
end
end
end
end
end
thread.join
thread[:chunk].to_s.match(regex).to_a.drop 1
end
end
end
4 changes: 2 additions & 2 deletions spec/support/matchers/wait_for_console_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def initialize(expected, options = {})
end

def matches?(actual)
actual.wait_for_output @expected
@value = actual.wait_for_output @expected
end

def description
"wait for match #{@expected.inspect} in console output"
"wait for match #{@expected.inspect} in console output #{@value}"
end
end

Expand Down

0 comments on commit d2ad255

Please sign in to comment.