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

Improve error message for test failure when mongotmock is not built

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I recently ran this sequence of commands.

       

      > bazel build :install-devcore
      > bazel build //src/mongo/db/query/search/mongotmock:mongotmock 
      > ./buildscripts/resmoke.py run --suites=auth jstests/auth/commands_builtin_roles_standalone.js

      And got the following error message

      [js_test:commands_builtin_roles_standalone] MongoDB shell version v8.2.0-alpha
      [js_test:commands_builtin_roles_standalone] mongotmock: 20040
      [js_test:commands_builtin_roles_standalone] {"t":{"$date":"2025-03-24T18:51:56.596Z"},"s":"I",  "c":"-",        "id":22810,   "ctx":"js","msg":"shell: Started program","attr":{"pid":"15800","port":-1,"argv":["mongotmock","--port=20040","--unixSocketPrefix=/data/db/job0/mongorunner/mongotmock/20040","--setParameter","enableTestCommands=1","-vvv","--pidfilepath=/data/db/job0/mongorunner/mongotmock/20040/cryptd.pid"]}}
      [js_test:commands_builtin_roles_standalone] tm15800| Unable to start program mongotmock: No such file or directory
      [js_test:commands_builtin_roles_standalone] Could not start mongo program at /data/db/job0/mongorunner/mongotmock/20040/mongocryptd.sock, process ended with exit code: 1
      [js_test:commands_builtin_roles_standalone] mongotmock sucessfully started.
      [js_test:commands_builtin_roles_standalone] uncaught exception: TypeError: mongotmock.getConnection() is null :
      [js_test:commands_builtin_roles_standalone] @jstests/auth/commands_builtin_roles_standalone.js:21:29 

      It is odd that the logs show:

      Unable to start program mongotmock: No such file or directory 

      and then immediately show after:

      mongotmock sucessfully started. 

      We should also add remediation steps into the error message, so future users know what to do to fix the problem. For example, the error message should say: 

      Please run `bazel build :install-dist-test`

       

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None