Skip to content

Commit

Permalink
Merge pull request #99 from jdantonio/spec_helper
Browse files Browse the repository at this point in the history
Added brute-force resets back to spec_helper to stabilize test suite.
  • Loading branch information
jdantonio committed May 27, 2014
2 parents 4fa3fba + 1415e6b commit f89bece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@

RSpec.configure do |config|
config.order = 'random'

config.before(:each) do
#TODO: Better configuration management in individual test suites
reset_gem_configuration
end

config.after(:each) do
#TODO: Better thread management in individual test suites
kill_rogue_threads(false)
end
end
4 changes: 2 additions & 2 deletions spec/support/example_group_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def reset_gem_configuration
Concurrent.instance_variable_set(:@configuration, Concurrent::Configuration.new)
end

def kill_rogue_threads
warn '[DEPRECATED] brute force thread control being used -- tests need updated'
def kill_rogue_threads(warning = true)
warn('[DEPRECATED] brute force thread control being used -- tests need updated') if warning
Thread.list.each do |thread|
thread.kill unless thread == Thread.current
end
Expand Down

0 comments on commit f89bece

Please sign in to comment.