[SERVER-44481] resmoke.py cannot enable failpoints from commandline Created: 07/Nov/19  Updated: 29/Oct/23  Resolved: 08/Nov/19

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

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Robert Guo (Inactive)
Resolution: Fixed Votes: 0
Labels: tig-resmoke
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-43593 Deploy TLA+ trace checker to Evergreen Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: STM 2019-11-14
Participants:

 Description   

We can configure failpoints at startup with command line arguments thus:

./mongod --setParameter enableTestCommands=1  --setParameter failpoint.dummy='{ "mode" : "alwaysOn" }'

So it should be possible to pass such command line args through resmoke.py, like:

buildscripts/resmoke.py --mongodSetParameters '{"failpoint.dummy": {"mode": "alwaysOn"}}'

This fails because resmoke doesn't know how to handle dotted parameter names when it generates the JavaScript that constructs TestData. Edited output:

[js_test:rollback_drop_database] 2019-11-07T15:22:05.884-0500 Starting JSTest jstests/replsets/rollback_drop_database.js...
mongo --eval TestData = new Object(); TestData.setParameters = new Object(); TestData.setParameters.failpoint.dummy = new Object(); TestData.setParameters.failpoint.dummy.mode = "alwaysOn"; jstests/replsets/rollback_drop_database.js
[js_test:rollback_drop_database] 2019-11-07T15:22:07.489-0500 2019-11-07T15:22:07.489-0500 E  QUERY    [js] uncaught exception: TypeError: TestData.setParameters.failpoint is undefined :

It tries to set TestData.setParameters.failpoint.dummy, but it hasn't created the "failpoint" property first.

Either resmoke.py should create a TestData.setParameters property named "failpoint.dummy" with the dot included, or it should create a property named "failpoint" and then a property named "dummy", I'm not sure which.



 Comments   
Comment by A. Jesse Jiryu Davis [ 08/Nov/19 ]

Thanks for the instafix!

Comment by Githook User [ 08/Nov/19 ]

Author:

{'email': 'robert.guo@mongodb.com', 'name': 'Robert Guo'}

Message: SERVER-44481 allow resmoke.py to set shell variables with dots from the command line
Branch: master
https://github.com/mongodb/mongo/commit/b877e1cbb39427255a54a5e05d981e3670091b94

Comment by Max Hirschhorn [ 07/Nov/19 ]

Either resmoke.py should create a TestData.setParameters property named "failpoint.dummy" with the dot included, or it should create a property named "failpoint" and then a property named "dummy", I'm not sure which.

It should probably create a property called "failpoint.dummy" because the --setParameter command line option isn't expecting a nested object. (Thus we can avoid doing more work in appendSetParameterArgs() in the mongo shell.) I think this can be solved by having resmoke.py use square brackets to refer to the "failpoint.dummy" property (or other names which aren't valid JavaScript identifiers) in its _format_shell_vars() function.

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