Skip to content

Commit 49f7cb3

Browse files
committed
Merge pull request #210 from ruby-concurrency/fix/thread-local-var-on-rbx
Exclude GC-dependent ThreadLocalVar test on Rbx
2 parents 204e770 + cec3ec1 commit 49f7cb3

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ branches:
2020

2121
matrix:
2222
allow_failures:
23-
- rvm: rbx-2
2423
- rvm: ruby-head
2524
- rvm: jruby-head
2625
- rvm: 1.9.3

spec/concurrent/atomic/thread_local_var_spec.rb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ module Concurrent
5151
expect(var.instance_variable_get(:@storage).keys.size).to be == 1
5252
end
5353

54-
it 'does not leave values behind when bind is not used' do
55-
tries = Array.new(10) do
56-
var = ThreadLocalVar.new(0)
57-
10.times.map do |i|
58-
Thread.new { var.value = i; var.value }
59-
end.each(&:join)
60-
var.value = 0
61-
GC.start
62-
var.instance_variable_get(:@storage).keys.size == 1
54+
unless rbx?
55+
#NOTE: This test depends on GC which works differently under Rbx
56+
it 'does not leave values behind when bind is not used' do
57+
tries = Array.new(10) do
58+
var = ThreadLocalVar.new(0)
59+
10.times.map do |i|
60+
Thread.new { var.value = i; var.value }
61+
end.each(&:join)
62+
var.value = 0
63+
GC.start
64+
var.instance_variable_get(:@storage).keys.size == 1
65+
end
66+
expect(tries.any?).to be_truthy
6367
end
64-
expect(tries.any?).to be_truthy
6568
end
6669
end
6770
end

0 commit comments

Comments
 (0)