Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20754

mongo/util/options_parser/options_parser_test fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.8
    • Fix Version/s: 3.2.0-rc2
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Build MongoDB with system boost 1.59

      Show
      Build MongoDB with system boost 1.59
    • Sprint:
      Platform B (10/30/15)

      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.

        Attachments

        1. boost.patch
          0.6 kB
        2. boost-1.59.patch
          3 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: