[SERVER-30327] Introduce ScalarGenerator interface for creating values of different BSON types in idempotency testing Created: 25/Jul/17  Updated: 30/Oct/23  Resolved: 11/Aug/17

Status: Closed
Project: Core Server
Component/s: Replication, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.5.12

Type: New Feature Priority: Major - P3
Reporter: Max Hirschhorn Assignee: May Hoque
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-30331 Enhance RandomizedScalarGenerator to ... Closed
Backwards Compatibility: Fully Compatible
Sprint: TIG 2017-08-21
Participants:

 Description   

The DocumentStructureEnumerator class added as part of SERVER-29795 always uses 0 for the scalar value in documents it generates. The UpdateSequenceGenerator class introduced in SERVER-29939 randomly selects between null, true, false, and double values between -INT_MAX and INT_MAX. In order to be able to detect idempotency issues related to different BSON types (e.g. type fidelity in $set, see SERVER-16801), we should accomodate being able to generate all possible BSON types.

To work around the lack of a BSONValue class (i.e. a BSONElement is a view into the memory owned by a BSONObj), we should use the Value class from the aggregation framework as the generic return type of some kind of generate() method.

We should have two concrete implementations of the ScalarGenerator interface:

  1. TrivialScalarGenerator should just return Value(0) and is what the self-tests for DocumentStructureEnumerator should use.
  2. RandomizedScalarGenerator should implement the existing behavior of UpdateSequenceGenerator.


 Comments   
Comment by Githook User [ 11/Aug/17 ]

Author:

{'name': 'may', 'email': 'may.hoque@mongodb.com'}

Message: SERVER-30327 Introduce ScalarGenerator interface for creating values of different BSON types in idempotency testing
Branch: master
https://github.com/mongodb/mongo/commit/75c889d8a4b0bdfa8cea7afbdec3541f2b7b79a2

Comment by May Hoque [ 11/Aug/17 ]

Have a wonderful day!

Generated at Thu Feb 08 04:23:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.