[SERVER-55140] Fix how ShardingTest handles setParameters Created: 10/Mar/21  Updated: 02/Apr/21  Resolved: 01/Apr/21

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

Type: Bug Priority: Major - P3
Reporter: Shreyas Kalyan Assignee: Benjamin Caimano (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-52944 Add additional audit sharding tests Closed
Operating System: ALL
Sprint: Security 2021-04-05
Participants:

 Description   

 

When adding setParameters for sharding tests like this:

options = {
    ...,
    other: {
      mongosOptions: {
        setParameter: {
          param1: val,
          param2 ...
        }
      },
    }
  }
st = new ShardingTest(options);

The test runner adds an extra setParameter - migrationLockAcquisitionMaxWaitMS for the mongos which causes it to fail to start. Instead, a user has to add set parameters like this - setParameter: "param1=val", which does not allow a user to specify multiple setParameters in an intuitive way (or possibly at all). See this example for how the ShardingTest set parameter needs to be specified.

 



 Comments   
Comment by Benjamin Caimano (Inactive) [ 01/Apr/21 ]

We have decided not to pursue this at this time due to its small impact on our test efficacy. For future reference, ShardingTest and ReplSetTest have two potential sources of unexpected behavior:

  • Object.merge() and Object.extend() are not invoked with "deep = true", which makes shallow copies of subobjects. These subobjects may then be mutated in unexpected ways.
  • Less seriously, options objects are defined with var and not let which carries the usual set of risks. (For instance, a mutated object from a past function invocation can be used in place of a fresh initialization.)
Generated at Thu Feb 08 05:35:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.