[SERVER-72472] Do not use collection.count() in test asserts Created: 03/Jan/23  Updated: 29/Oct/23  Resolved: 12/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2023-01-09, QE 2023-01-23
Participants:
Linked BF Score: 149

 Description   

The issue started to pop up on MacOS builds after changing the change_stream_pit_pre_images.js test:

  • replaces friendlyEqual() with bsonUnorderedFieldsCompare() in assert.docEq() as the use of friendlyEqual() is discouraged
  • adjusted change_stream_pit_pre_images.js to use coll.count() and coll.hashAllDocs(), because bsonUnorderedFieldsCompare() does not support arguments over 16MB (SERVER-71979)

However, using coll.count() in test asserts can lead to sporadic failures (as described here).



 Comments   
Comment by Githook User [ 12/Jan/23 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-72472 Avoid using coll.count() in test assertion
Branch: master
https://github.com/mongodb/mongo/commit/c64dc2b5e425a231c20dfa564649afcdaf06f144

Generated at Thu Feb 08 06:21:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.