Skip to content

Commit

Permalink
Fix failing testcase when using SynchronizedMapBackend
Browse files Browse the repository at this point in the history
The SynchronizedMapBackend, by definition, uses a lock around every
operation, and thus could never pass a test that checks that updates
and reads can happen concurrently.
  • Loading branch information
ivoanjo committed Mar 29, 2017
1 parent df52663 commit b0e2216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/concurrent/map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ module Concurrent
end

it 'updates dont block reads' do
if defined?(Concurrent::Collection::SynchronizedMapBackend) && described_class <= Concurrent::Collection::SynchronizedMapBackend
skip("Test does not apply to #{Concurrent::Collection::SynchronizedMapBackend}")
end

getters_count = 20
key_klass = Concurrent::ThreadSafe::Test::HashCollisionKey
keys = [key_klass.new(1, 100),
Expand Down

0 comments on commit b0e2216

Please sign in to comment.