[SERVER-20754] mongo/util/options_parser/options_parser_test fails Created: 05/Oct/15  Updated: 28/Sep/16  Resolved: 27/Oct/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: 3.1.8
Fix Version/s: 3.2.0-rc2

Type: Bug Priority: Major - P3
Reporter: Marek Skalický Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File boost-1.59.patch     File boost.patch    
Issue Links:
Depends
is depended on by SERVER-22525 Fix implicit options usage in test cases Closed
Documented
is documented by DOCS-8959 mongo/util/options_parser/options_par... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Steps To Reproduce:

Build MongoDB with system boost 1.59

Sprint: Platform B (10/30/15)
Participants:

 Description   

I was trying to build MongoDB with boost 1.59 and optons_parser_test was failing.

2015-09-18T10:41:18.279+0000 I -        **************************************************
2015-09-18T10:41:18.279+0000 I -        ChainingInterface              | tests:   18 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        ConfigFromFilesystem           | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.169
2015-09-18T10:41:18.279+0000 I -        Constraints                    | tests:    4 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        INIConfigFile                  | tests:   12 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        JSONConfigFile                 | tests:   17 | fails:    0 | assert calls:          0 | time secs:  0.004
2015-09-18T10:41:18.279+0000 I -        LegacyInterface                | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        NumericalBaseParsing           | tests:    3 | fails:    0 | assert calls:          0 | time secs:  0.001
2015-09-18T10:41:18.279+0000 I -        OptionCount                    | tests:    1 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        OptionSources                  | tests:    6 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        Parsing                        | tests:   23 | fails:    1 | assert calls:          0 | time secs:  0.000
	ImplicitValueOverride	Expected ::mongo::Status::OK() == (parser.run(testOpts, argv, env_map, &environment)) (OK  == BadValue Error parsing command line: too many positional options have been specified on the command line) @src/mongo/util/options_parser/options_parser_test.cpp:768
2015-09-18T10:41:18.279+0000 I -        Registration                   | tests:   12 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        Style                          | tests:    4 | fails:    0 | assert calls:          0 | time secs:  0.000
2015-09-18T10:41:18.279+0000 I -        YAMLConfigFile                 | tests:   26 | fails:    0 | assert calls:          0 | time secs:  0.004
2015-09-18T10:41:18.279+0000 I -        TOTALS                         | tests:  132 | fails:    1 | assert calls:          0 | time secs:  0.180
2015-09-18T10:41:18.279+0000 I -        Failing tests:
2015-09-18T10:41:18.279+0000 I -        	 Parsing/ImplicitValueOverride Failed
2015-09-18T10:41:18.279+0000 I -        FAILURE - 1 tests in 1 suites failed

This is the bug in this test. This exception is expected - see the mailing list question http://lists.boost.org/boost-users/2015/09/85096.php

Documentation of boost::typed_value::implicit_value

Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: 'ovalue' or 'option=value'. Giving '-o' or '-option' will cause the implicit value to be applied. Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user.

So with this args:

argv.push_back("binaryname");
argv.push_back("--port");
argv.push_back("5");

test should fail also with boost 1.56 ... !

Attached patch should fix this.



 Comments   
Comment by Mark Benvenuto [ 22/Mar/16 ]

This change was reverted by SERVER-22525 since it also broke how the password parameter worked in the mongo shell.

Comment by Githook User [ 27/Oct/15 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-20754 Fixes to support building against system boost 1.59
Branch: master
https://github.com/mongodb/mongo/commit/53ce96ad0f9d410ef86dc3ad3a4bd45e0ea5eef1

Comment by Marek Skalický [ 19/Oct/15 ]

Also some other tests are failing due to this error.

Boost-1.59 contains full patch.

There is only one problem that CommandLineEmptyString test don't pass with

argv=["binaryname"]

And the error is really weird for me:

CommandLineEmptyString	Expected ::mongo::logger::globalLogDomain()->getMinimumLogSeverity() == ::mongo::logger::LogSeverity::Debug(verbosity) (info == info) @src/mongo/db/server_options_test.cpp:170

So it mentioned patch this test is disabled.

Do you know, where the problem could be?

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