File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 239239 ( 1 ..3 ) . map { |i | { field : "test#{ i } " } }
240240 end
241241
242+ let ( :cluster ) do
243+ authorized_client . cluster
244+ end
245+
242246 before do
243247 authorized_collection . insert_many ( documents )
244- cursor_reaper . schedule_kill_cursor ( cursor . id ,
245- cursor . send ( :kill_cursors_op_spec ) ,
246- cursor . instance_variable_get ( :@server ) )
248+ cluster . schedule_kill_cursor ( cursor . id ,
249+ cursor . send ( :kill_cursors_op_spec ) ,
250+ cursor . instance_variable_get ( :@server ) )
247251 end
248252
249253 after do
263267 view . instance_variable_get ( :@cursor )
264268 end
265269
266- let ( :cursor_reaper ) do
267- authorized_client . cluster . instance_variable_get ( :@cursor_reaper )
268- end
269-
270- it 'schedules a kill cursors op' , unless : sessions_enabled? do
271- sleep ( Mongo ::Cluster ::PeriodicExecutor ::FREQUENCY )
270+ it 'schedules a kill cursors op' do
271+ cluster . instance_variable_get ( :@periodic_executor ) . flush
272272 expect {
273273 cursor . to_a
274274 } . to raise_exception ( Mongo ::Error ::OperationFailure )
277277 context 'when the cursor is unregistered before the kill cursors operations are executed' do
278278
279279 it 'does not send a kill cursors operation for the unregistered cursor' do
280- cursor_reaper . unregister_cursor ( cursor . id )
280+ cluster . unregister_cursor ( cursor . id )
281281 expect ( cursor . to_a . size ) . to eq ( documents . size )
282282 end
283283 end
You can’t perform that action at this time.
0 commit comments