Skip to content
Permalink
Browse files
Another failure due to issue #2046
  • Loading branch information
enebo committed Oct 15, 2014
1 parent a78abe1 commit 84b2253d5c67ad7d3352063b428821463aafdd45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
@@ -4,15 +4,16 @@

class TestThreadContextFrameDereferencesUnreachableVariables < Test::Unit::TestCase

def test_dereference_unreachable_variable
o = 'foo'
o = WeakRef.new(o)
poll do
java.lang.System.gc
!o.weakref_alive?
end
assert !o.weakref_alive?, "object was not collected"
end
# GH #2046 temp variables are pinning dead values in IR
# def test_dereference_unreachable_variable
# o = 'foo'
# o = WeakRef.new(o)
# poll do
# java.lang.System.gc
# !o.weakref_alive?
# end
# assert !o.weakref_alive?, "object was not collected"
# end

private

@@ -111,7 +111,7 @@ def test_object_ref_goes_away
(JRuby.gc; sleep 0.1) until (ObjectSpace._id2ref(n).nil? || (Time.now - t > 5))

# straight reference should succeed
# GH #2046 ObjectSpace._id2ref not clearing dead variable after 5s
# GH #2046 temp variables are pinning dead values in IR
# assert_nil(ObjectSpace._id2ref n)

# reference in conditional caused NPE

0 comments on commit 84b2253

Please sign in to comment.