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

Improve the debugging of change stream test-suite

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Query Execution 2021-05-31, Query Execution 2021-06-14
    • 26

    Description

      Currently, the change stream does not log 2 objects that are being compared if there is an assertion failure. Consider the snippet:

      assert.eq(bsonWoCompare(getMorePBRT, txnEvent3._id), 0);

      Where if getMorePBRT != txnEvent3._id and the test case fails, we have no way to figure out what value these two objects contain.

      Logging such objects' values might help in making a correlation with the C++ logs.

      The proposal here is to do something like this:

      Just before such assertion checks, create a dictionary containing objects been compared.
      Like this for the above example:

      let objectValues = {
        getMorPBRT: getMortPBRT,
        txnEvent3_id: txnEvent3._id
      }
      

      And then checking fo the condition like this:

      assert.eq(bsonWoCompare(getMorePBRT, txnEvent3._id), 0, objectValues);

       

      In case of assertion failure, the object_values will be dumped.

      Attachments

        Activity

          People

            rishab.joshi@mongodb.com Rishab Joshi (Inactive)
            rishab.joshi@mongodb.com Rishab Joshi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: