Subtract the size of the clusterTime
@@ -3411,6 +3411,12 @@ test_bulk_max_msg_size (void)
mongoc_collection_drop (collection, NULL);
+ /* Cluster time document argument is injected sometimes */
+ if (!bson_empty (&client->topology->description.cluster_time)) {
+ filler_string -= client->topology->description.cluster_time.len +
+ strlen ("$clusterTime") + 2;
+ }
+
/* {{{ Exactly 48 000 000 bytes (not to be confused with 48mb!) */
bulk = mongoc_collection_create_bulk_operation (collection, true, wc);
/* 16 mb doc */
