Skip to content

Commit c9af018

Browse files
committed
Removed ThreadLocalVar test that depended on forcing GC.
1 parent 27583f9 commit c9af018

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

spec/concurrent/atomic/semaphore_spec.rb

100755100644
File mode changed.

spec/concurrent/atomic/thread_local_var_spec.rb

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,6 @@ module Concurrent
5050
var.value = 0
5151
expect(var.instance_variable_get(:@storage).keys.size).to be == 1
5252
end
53-
54-
# TODO this test is really bad, but better than nothing.
55-
it 'does not leave values behind when bind is not used' do
56-
# TODO find out why it fails from the begging sometimes, hence the 3 tries
57-
tries = Array.new(3) 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-
# TODO find out why long sleep is necessary, does it take longer for threads to be collected?
64-
sleep 1
65-
if rbx?
66-
GC.run true # force GC run
67-
else
68-
GC.start
69-
end
70-
var.instance_variable_get(:@storage).keys.size
71-
end
72-
expect(tries.any? { |v| v == 1 }).to be_truthy
73-
end
7453
end
7554
end
7655

0 commit comments

Comments
 (0)