File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -762,6 +762,26 @@ def test_startafter_resume_uses_resumeafter_after_nonempty_getMore(self):
762762 self .assertIsNotNone (response .command ["pipeline" ][0 ]["$changeStream" ].get ("resumeAfter" ))
763763 self .assertIsNone (response .command ["pipeline" ][0 ]["$changeStream" ].get ("startAfter" ))
764764
765+ # Prose test no. 19
766+ @no_type_check
767+ @client_context .require_version_min (7 , 0 , - 1 )
768+ def test_split_large_change (self ):
769+ self .db .drop_collection ("test_split_large_change" )
770+ coll = self .db .create_collection (
771+ "test_split_large_change" , changeStreamPreAndPostImages = {"enabled" : True }
772+ )
773+ coll .insert_one ({"_id" : 1 , "value" : "q" * 10 * 1024 * 1024 })
774+ with coll .watch (
775+ [{"$changeStreamSplitLargeEvent" : {}}], full_document_before_change = "required"
776+ ) as change_stream :
777+ coll .update_one ({"_id" : 1 }, {"$set" : {"value" : "z" * 10 * 1024 * 1024 }})
778+ doc_1 = change_stream .next ()
779+ self .assertIn ("splitEvent" , doc_1 )
780+ self .assertEqual (doc_1 ["splitEvent" ], {"fragment" : 1 , "of" : 2 })
781+ doc_2 = change_stream .next ()
782+ self .assertIn ("splitEvent" , doc_2 )
783+ self .assertEqual (doc_2 ["splitEvent" ], {"fragment" : 2 , "of" : 2 })
784+
765785
766786class TestClusterChangeStream (TestChangeStreamBase , APITestsMixin ):
767787 dbs : list
You can’t perform that action at this time.
0 commit comments