[SERVER-20894] Tests incorrectly specify {auth: null} to MongoRunner when trying to enable auth Created: 13/Oct/15  Updated: 06/Dec/22  Resolved: 05/Nov/21

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

Type: Task Priority: Trivial - P5
Reporter: Max Hirschhorn Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Won't Fix Votes: 0
Labels: stm, tig-mongorunner
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Tooling & Methods
Participants:

 Description   

Affects the following tests:

The --keyFile argument ends up implying to run with auth enabled. Note that we shouldn't need to enable the HTTP interface for these tests.



 Comments   
Comment by Max Hirschhorn [ 13/Oct/15 ]

andreas.nilsson, technically there is nothing to fix. However, I think we should change {auth: null} to {auth: ''} so that --auth actually gets passed to the mongod that is started and avoid future confusion.

Comment by Max Hirschhorn [ 13/Oct/15 ]

jstests/multiVersion/upgrade_cluster_v5_to_v6.js specifies {smallfiles: null} in a comment.

The behavior of nullish (i.e. null and undefined) options to MongoRunner vs ReplTest is different:

In MongoRunner, keys with a value that is nullish are skipped entirely:

if( o[k] == undefined || o[k] == null ) continue
fullArgs.push( "--" + k )
if ( o[k] != "" )
    fullArgs.push( "" + o[k] )

whereas keys with a value that is nullish are treated as a --switch in ReplTest:

for ( var k in extra ){
    var v = extra[k];
    if( k in MongoRunner.logicalOptions ) continue
    a.push( "--" + k );
    if ( v != null && v !== "")
        a.push( v );
}

This causes journaling to actually be enabled in (and necessarily so):

Generated at Thu Feb 08 03:55:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.