Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1988

Report "data" as hex bytes in MongoDB\BSON\Binary debug output

    • Type: Icon: Build Failure Build Failure
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Tests

      We occasionally encounter test failures (example) due to newline or non-printable characters appearing in binary data (e.g. logical session IDs). For example:

      ========DIFF========
      [2021/10/11 18:31:51.252] 007+       string(16) "��إbIF���JT
      [2021/10/11 18:31:51.252] 008+ J"
      [2021/10/11 18:31:51.252] 007-       string(16) "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c"
      [2021/10/11 18:31:51.252] ========DONE========
      [2021/10/11 18:31:51.252] FAIL MongoDB\Driver\Session debug output (before an operation) [tests/session/session-debug-001.phpt]
      

      While we could likely work around this in tests by using "%A" to permit whitespace, it may make more sense to report MongoDB\BSON\Binary's "data" field as hex bytes in debug output.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: