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

Fix failures due to command specification as dict instead of SON

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.10
    • Affects Version/s: None
    • Component/s: Tests
    • None

      The failpoint contextmanager introduced in https://github.com/mongodb/mongo-python-driver/commit/e31a0ef95f8cc397eb7d0b4bc83916817acc0a53 attempts to disable the failpoint using a command specified as a dictionary which sometimes results in mode: off being passed before configureFailPoint: failCommand which results in the following failure:

      ERROR: no such command: 'mode' (OperationFailure)
       Traceback (most recent call last):
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/test/_init_.py", line 433, in wrap
       return f(*args, **kwargs)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/test/test_change_stream.py", line 550, in test_no_resume_attempt_if_aggregate_command_fails
       pass
       File "/opt/python/3.4/lib/python3.4/contextlib.py", line 66, in _exit_
       next(self.gen)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/test/_init_.py", line 745, in fail_point
       self.client.admin.command(cmd_off)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/pymongo/database.py", line 733, in command
       codec_options, session=session, **kwargs)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/pymongo/database.py", line 630, in _command
       client=self.__client)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/pymongo/pool.py", line 613, in command
       user_fields=user_fields)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/pymongo/network.py", line 167, in command
       parse_write_concern_error=parse_write_concern_error)
       File "/data/mci/dd7d7193a148f621f976bdc953a64d71/src/pymongo/helpers.py", line 159, in _check_command_response
       raise OperationFailure(msg % errmsg, code, response)
       pymongo.errors.OperationFailure: no such command: 'mode'

            Assignee:
            prashant.mital Prashant Mital (Inactive)
            Reporter:
            prashant.mital Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: