Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2730

Remove redundant logic for placeholders in spec tests

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.14.0
    • Affects Version/s: 1.13.0
    • Component/s: Testing
    • None

      Most spec tests allow 42 as a placeholder value for cursor ids, error codes, lsids, readConcern.afterClusterTime. So when event callbacks are generated, convert_message_for_test checks these specific fields, converting the actual values to 42 to match what the spec will compare against.

      However, in the change stream spec tests (CDRIVER-2670) 42 is allowed as a placeholder for any field. So instead of converting the command monitoring events when they're generated, change streams have a special match context flag, allow_placeholders allowing match_bson_value to interpret the value 42 to mean "match any value".

      Consequently there's redundancy between what the allow_placeholders flag and the convert_message_for_test function accomplish.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: