File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
ravendb/tests/jvm_migrated_tests/client_tests/subscriptions_tests Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -566,3 +566,22 @@ def test_should_throw_on_attempt_to_open_already_opened_subscription(self):
566566 with self .assertRaises (SubscriptionInUseException ):
567567 task = second_subscription .run (lambda x : None )
568568 task .result (self .reasonable_amount_of_time )
569+
570+ def test_should_pull_documents_after_bulk_insert (self ):
571+ key = self .store .subscriptions .create_for_class (User , SubscriptionCreationOptions ())
572+ with self .store .subscriptions .get_subscription_worker (SubscriptionWorkerOptions (key ), User ) as subscription :
573+ with self .store .bulk_insert () as bulk_insert :
574+ bulk_insert .store_by_entity (User ())
575+ bulk_insert .store_by_entity (User ())
576+ bulk_insert .store_by_entity (User ())
577+
578+ users : List [User ] = []
579+ third_user_processed = Event ()
580+
581+ def __subscription_callback (x : SubscriptionBatch ):
582+ users .extend ([item .result for item in x .items ])
583+ if len (users ) == 3 and all ([user is not None for user in users ]):
584+ third_user_processed .set ()
585+
586+ subscription .run (__subscription_callback )
587+ third_user_processed .wait (timeout = 5 )
You can’t perform that action at this time.
0 commit comments