File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -51,19 +51,23 @@ def loop_times(times)
5151 end
5252
5353 after ( :all ) do
54+ @users_to_delete = @created_users . dup + @fellowship_of_the_ring . map { |fellow | fellow [ :id ] }
5455 curr_idx = 0
5556 batch_size = 25
5657
57- slice = @created_users . slice ( 0 , batch_size )
58+ slice = @users_to_delete . slice ( 0 , batch_size )
5859
5960 while !slice . nil? && !slice . empty?
6061 @client . delete_users ( slice , user : StreamChat ::HARD_DELETE , messages : StreamChat ::HARD_DELETE )
6162
6263 curr_idx += batch_size
63- slice = @created_users . slice ( curr_idx , batch_size )
64+ slice = @users_to_delete . slice ( curr_idx , batch_size )
6465 end
6566
6667 @channel . delete
68+ rescue StreamChat ::StreamAPIException
69+ # if the channel is already deleted by the test, we can ignore the error
70+ logger . info "Error cleaning up testcase: #{ e . message } "
6771 end
6872
6973 it 'properly sets up a new client' do
Original file line number Diff line number Diff line change @@ -54,13 +54,15 @@ def loop_times(times)
5454 curr_idx = 0
5555 batch_size = 25
5656
57- slice = @created_users . slice ( 0 , batch_size )
57+ @users_to_delete = @created_users . dup + @fellowship_of_the_ring . map { |fellow | fellow [ :id ] }
58+
59+ slice = @users_to_delete . slice ( 0 , batch_size )
5860
5961 while !slice . nil? && !slice . empty?
6062 @client . delete_users ( slice , user : StreamChat ::HARD_DELETE , messages : StreamChat ::HARD_DELETE )
6163
6264 curr_idx += batch_size
63- slice = @created_users . slice ( curr_idx , batch_size )
65+ slice = @users_to_delete . slice ( curr_idx , batch_size )
6466 end
6567
6668 @channel . delete
You can’t perform that action at this time.
0 commit comments