Merge remote-tracking branch 'parent/main' into upstream-20230209
This commit is contained in:
commit
05e52a09a8
188 changed files with 2810 additions and 1295 deletions
|
@ -1246,19 +1246,10 @@ RSpec.describe Account do
|
|||
it 'increments the count in multi-threaded an environment when account_stat is not yet initialized' do
|
||||
subject
|
||||
|
||||
increment_by = 15
|
||||
wait_for_start = true
|
||||
|
||||
threads = Array.new(increment_by) do
|
||||
Thread.new do
|
||||
true while wait_for_start
|
||||
described_class.find(subject.id).increment_count!(:followers_count)
|
||||
end
|
||||
multi_threaded_execution(15) do
|
||||
described_class.find(subject.id).increment_count!(:followers_count)
|
||||
end
|
||||
|
||||
wait_for_start = false
|
||||
threads.each(&:join)
|
||||
|
||||
expect(subject.reload.followers_count).to eq 15
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue