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

Properly assert that expected log messages are present in invalid_index_spec.js and initial_sync_invalid_index_spec.js

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • ALL
    • Execution Team 2021-06-14

      In invalid_index_spec.js and initial_sync_invalid_index_spec.js, we verify whether a log message is present using

      assert(rawMongoProgramOutput().search(/regex/));
      

      However, the search() function returns the index of the first match, or -1 if there was no match. Thus, the current usage does not properly assert that the log message is present. These should be changed to either

      assert.neq(rawMongoProgramOutput().search(/regex/), -1);
      

      or

      assert(/regex/.test(rawMongoProgramOutput());
      

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: