ReplSetTest doesn't work on mac os out of the box

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • ALL
    • Hide
      1. Checkout mongo repo on mac book.
      2. Get mac binaries
        1. Build them (slow)
        2. Download from Evergreen
      3. Run the following command 
        ./buildscripts/resmoke.py run --suite serial_run --dbpathPrefix test_data --installDir ~/Projects/resmoke_binaries/bin/ jstests/serial_run/out_max_time_ms.js
      1. Expected result: test succeeeds.
      2. Actual result: test failed with the error from the ticket

      Note: --dbpathPrefix is needed because the default value for it is `/data` and `/` is read-only on mac os.

      Show
      Checkout mongo repo on mac book. Get mac binaries Build them (slow) Download from Evergreen Run the following command  ./buildscripts/resmoke.py run --suite serial_run --dbpathPrefix test_data --installDir ~/Projects/resmoke_binaries/bin/ jstests/serial_run/out_max_time_ms.js Expected result: test succeeeds. Actual result: test failed with the error from the ticket Note: --dbpathPrefix is needed because the default value for it is `/data` and `/` is read-only on mac os.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We have a lot of no passthrough suites that create their own replica sets using ReplSetTest.

      On mac os x (tested on my work laptop) this fails with the following error: 

       [js_test:out_max_time_ms] Error: command did not fail with any of the following codes [ 74, 103, 11602, 109, 308, 10107 ] {
      [js_test:out_max_time_ms]   "ok" : 0,
      [js_test:out_max_time_ms]   "errmsg" : "No host described in new configuration with {version: 1, term: 0} for replica set out_max_time_ms maps to this node",
      [js_test:out_max_time_ms]   "code" : 93,
      [js_test:out_max_time_ms]   "codeName" : "InvalidReplicaSetConfig"
      [js_test:out_max_time_ms] } : replSetInitiate during initiate failed

      The reason for this is that it uses host name in replica set config:

      "host" : "M-PN<your mac name>:20040" 

      And out of the box DNS won't resolve it.

      This is controlled by "useHostName" option in ReplSetTest constructor:

      https://github.com/mongodb/mongo/blob/b82386bde98951f0ce7a60c19952f239e0165f7c/jstests/libs/replsettest.js#L3483

       

      There are two workarounds:

      1. Edit your /etc/hosts to include your host name.
        1. Works for all tests
        2. Requires sudo and editing system preferences
      2. Add "useHostName" to ReplSetTest options
        1. Works only for the test your run
        2. Does not require changing your system

      It would be great for it to work out of the box somehow.

            Assignee:
            Unassigned
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: