Skip to content
Browse files

- More test parallelization 'fixes' :/

[git-p4: depot-paths = "//src/minitest/dev/": change = 8100]
  • Loading branch information...
1 parent 611d02f commit 1dde8a36855a5dd92dded6e593b3b122159f54db @zenspider zenspider committed Jan 2, 2013
Showing with 37 additions and 32 deletions.
  1. +37 −32 test/minitest/test_minitest_unit.rb
View
69 test/minitest/test_minitest_unit.rb
@@ -172,37 +172,6 @@ def test_default_runner_is_minitest_unit
assert_instance_of MiniTest::Unit, MiniTest::Unit.runner
end
- def with_overridden_include
- Class.class_eval do
- def inherited_with_hacks klass
- throw :inherited_hook
- end
-
- alias inherited_without_hacks inherited
- alias inherited inherited_with_hacks
- alias IGNORE_ME! inherited # 1.8 bug. god I love venture bros
- end
-
- yield
- ensure
- Class.class_eval do
- alias inherited inherited_without_hacks
-
- undef_method :inherited_with_hacks
- undef_method :inherited_without_hacks
- end
-
- refute_respond_to Class, :inherited_with_hacks
- refute_respond_to Class, :inherited_without_hacks
- end
-
- def test_inherited_hook_plays_nice_with_others
- with_overridden_include do
- assert_throws :inherited_hook do
- Class.new MiniTest::Unit::TestCase
- end
- end
- end
def test_passed_eh_teardown_good
test_class = Class.new MiniTest::Unit::TestCase do
@@ -246,6 +215,40 @@ def util_expand_bt bt
end
end
+class TestMiniTestUnitInherited < MetaMetaMetaTestCase
+ def with_overridden_include
+ Class.class_eval do
+ def inherited_with_hacks klass
+ throw :inherited_hook
+ end
+
+ alias inherited_without_hacks inherited
+ alias inherited inherited_with_hacks
+ alias IGNORE_ME! inherited # 1.8 bug. god I love venture bros
+ end
+
+ yield
+ ensure
+ Class.class_eval do
+ alias inherited inherited_without_hacks
+
+ undef_method :inherited_with_hacks
+ undef_method :inherited_without_hacks
+ end
+
+ refute_respond_to Class, :inherited_with_hacks
+ refute_respond_to Class, :inherited_without_hacks
+ end
+
+ def test_inherited_hook_plays_nice_with_others
+ with_overridden_include do
+ assert_throws :inherited_hook do
+ Class.new MiniTest::Unit::TestCase
+ end
+ end
+ end
+end
+
class TestMiniTestRunner < MetaMetaMetaTestCase
# do not parallelize this suite... it just can't handle it.
@@ -669,7 +672,9 @@ def test_setup_and_teardown_survive_inheritance
end
class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
- parallelize_me!
+ # do not call parallelize_me! - teardown accesses @tc._assertions
+ # which is not threadsafe. Nearly every method in here is an
+ # assertion test so it isn't worth splitting it out further.
RUBY18 = ! defined? Encoding

0 comments on commit 1dde8a3

Please sign in to comment.
Something went wrong with that request. Please try again.