Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4349

[Build Failure] Snappy Test Failures on PyPy 3.8

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Name of Failure:

      All tests are failing when using snappy with PyPy 3.8.

      Link to task:

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_rhel8_compression__platform~rhel8_compression~snappy_python_version~pypy3.8_c_extensions~without_c_extensions_test_4.2_standalone_48d5a46e46e88e337df8cd8ae0fbb77788746e9d_24_04_08_18_34_51/tests?execution=0&sortBy=STATUS&sortDir=ASC

      Context of when and why the failure occurred:

      python-snappy now depends on cramjam, which only supports PyPy 3.9+. We'd need a way to specify using an earlier version (cramjam 2.7) when using PyPy 3.8.

      Stack trace:

       [2024/04/08 18:38:23.734] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/04/08 18:38:23.734] test/__init__.py:1159: in setup
       [2024/04/08 18:38:23.734]     client_context.init()
       [2024/04/08 18:38:23.734] test/__init__.py:485: in init
       [2024/04/08 18:38:23.735]     self._init_client()
       [2024/04/08 18:38:23.736] test/__init__.py:348: in _init_client
       [2024/04/08 18:38:23.736]     self.client = self._connect(host, port)
       [2024/04/08 18:38:23.736] test/__init__.py:345: in _connect
       [2024/04/08 18:38:23.736]     client.close()
       [2024/04/08 18:38:23.736] pymongo/mongo_client.py:1225: in close
       [2024/04/08 18:38:23.736]     self._end_sessions(session_ids)
       [2024/04/08 18:38:23.736] pymongo/mongo_client.py:1202: in _end_sessions
       [2024/04/08 18:38:23.736]     conn.command("admin", spec, read_preference=read_pref, client=self)
       [2024/04/08 18:38:23.736] pymongo/helpers.py:324: in inner
       [2024/04/08 18:38:23.736]     return func(*args, **kwargs)
       [2024/04/08 18:38:23.736] pymongo/pool.py:1013: in command
       [2024/04/08 18:38:23.736]     self._raise_connection_failure(error)
       [2024/04/08 18:38:23.736] pymongo/pool.py:985: in command
       [2024/04/08 18:38:23.736]     return command(
       [2024/04/08 18:38:23.736] pymongo/network.py:152: in command
       [2024/04/08 18:38:23.736]     request_id, msg, size, max_doc_size = message._op_msg(
       [2024/04/08 18:38:23.736] pymongo/message.py:757: in _op_msg
       [2024/04/08 18:38:23.736]     return _op_msg_compressed(flags, command, identifier, docs, opts, ctx)
       [2024/04/08 18:38:23.736] pymongo/message.py:712: in _op_msg_compressed
       [2024/04/08 18:38:23.736]     rid, msg = _compress(2013, msg, ctx)
       [2024/04/08 18:38:23.736] pymongo/message.py:637: in _compress
       [2024/04/08 18:38:23.736]     compressed = ctx.compress(data)
       [2024/04/08 18:38:23.736] pymongo/compression_support.py:120: in compress
       [2024/04/08 18:38:23.736]     return snappy.compress(data)
       [2024/04/08 18:38:23.736] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/04/08 18:38:23.736] data = b'\x00\x00\x00\x00\x00G\x00\x00\x00\x04endSessions\x00&\x00\x00\x00\x030\x00\x1e\x00\x00\x00\x05id\x00\x10\x00\x00\x00\x04g\xc8\x8dq\xd0\xf9N\xce\x9e\x10\xa3\xdbf\xa6\xcf\xf3\x00\x00\x02$db\x00\x06\x00\x00\x00admin\x00\x00'
       [2024/04/08 18:38:23.736] encoding = 'utf-8'
       [2024/04/08 18:38:23.736]     def compress(data, encoding='utf-8'):
       [2024/04/08 18:38:23.736]         if isinstance(data, str):
       [2024/04/08 18:38:23.736]             data = data.encode(encoding)
       [2024/04/08 18:38:23.736] >       return bytes(_compress(data))
       [2024/04/08 18:38:23.736] E       TypeError: 'Buffer' object is not iterable
      

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: