[SERVER-60463] Generate documents of exactly 1MB in autosplitter unit tests Created: 05/Oct/21  Updated: 29/Oct/23  Resolved: 07/Oct/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 5.1.0
Fix Version/s: 5.2.0, 5.1.0-rc1

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.1
Sprint: Sharding EMEA 2021-10-18
Participants:
Linked BF Score: 164

 Description   

The 1MB field generated here plus the padding results in a document size slightly bigger than 1MB (1048600 bytes instead of 1047576). This can lead to errors in randomly generated test cases that are playing on autosplitter thresholds corner cases (e.g. maxChunkSize` 56MB and surplus 18MB).

Changing the 1024 * 1024 with 1024 * 1023 seems to generate documents of exactly 1MB, allowing the unit tests to be always be correct.



 Comments   
Comment by Githook User [ 07/Oct/21 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-60463 Generate documents of exactly 1MB in autosplitter unit tests
Branch: master
https://github.com/mongodb/mongo/commit/1dbfb23e24070706c21009e53c80e27f11632076

Generated at Thu Feb 08 05:49:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.