Sonny Chee
2007-Mar-16 19:51 UTC
Funky deadlocking of activerecord thread by Test::Unit ...
Hey Guys,
The following works fine. TaskInterrupt is a ActiveRecord subclass.
require File.dirname(__FILE__) + ''/../test_helper''
def test_1
aproc = lambda{ TaskInterrupt.new.pause(''blue'') }
threads = Thread.new(aproc) { |r| aproc.call }
threads.join
puts "join done"
end
test_1
However the following yields deadlock errors shown at the end of this
posting. As you can see the only difference between these two is that
the latter uses the Test::Unit Framework. Anyone have ideas how I can
workaround / trace this issue?
require File.dirname(__FILE__) + ''/../test_helper''
class TestBlue < Test::Unit::TestCase
def test_1
aproc = lambda{ TaskInterrupt.new.pause(''blue'') }
threads = Thread.new(aproc) { |r| aproc.call }
threads.join
puts "join done"
end
end
deadlock 0x288c80c: sleep:J(0x39b42c4) (main) - unit/test.rb:8
deadlock 0x39b42c4: sleep:- - c:/ruby/lib/ruby/1.8/thread.rb:100
c:/ruby/lib/ruby/1.8/thread.rb:100:in `test_1'': Thread(0x39b42c4):
deadlock (fatal)
from c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:72:in
`__send__''
from c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:72:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each''
from c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run''
from
c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite''
from
c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator''
from
c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start''
from
c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run''
from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run''
from c:/ruby/lib/ruby/1.8/test/unit.rb:278
from unit/test.rb:5
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---