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

Javascript line numbers inaccurate on windows if file uses multi-line template literal

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • JavaScript, Shell
    • None
    • Query Execution
    • ALL
    • 0

    Description

      See this stack trace generated in a test failure:

      doassert@src/mongo/shell/assert.js:18:14
      assert.lt@src/mongo/shell/assert.js:444:5
      assertEventWakesCursor@jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:109:9
      @jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:130:29
      @jstests\aggregation\sources\changeStream\only_wake_getmore_for_relevant_changes.js:3:2
      

      Here's only_wake_getmore_for_relevant_changes.js at the git version of this failure - you can see that line 109 is not within the function assertEventWakesCursor, nor is there a call to assert.lt on line 109. However, if you subtract 11 lines, which is the length of the template string literal starting on line 29, that leads you to line 98 - an assert.lt within the assertEventWakesCursor helper.

      The stack traces have correct line numbers locally on linux and mac, and the only other test I could find with a multi-line template literal was ssl_with_system_ca.js, which doesn't seem to have ever failed on windows.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: