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

SpecTestRunner for CRUD v2 format should be able to run against server versions without sessions support

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

      As currently implemented, the SpecRunner cannot be used to run tests against MongoDB versions that do not support sessions. This is because of the code that creates sessions for use in the transactions spec tests is always executed even when entirely different spec tests are being run. This causes the runner to error with the following traceback:

      ======================================================================
      ERROR: test_v2_updateOne_hint_clientError_UpdateOne_with_hint_document_unsupported_(client-side_error) (test.test_crud_v2.TestSpec)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/pmital/Developer/mongo-python-driver/test/__init__.py", line 447, in wrap
          return f(*args, **kwargs)
        File "/Users/pmital/Developer/mongo-python-driver/test/test_crud_v2.py", line 62, in run_scenario
          self.run_scenario(scenario_def, test)
        File "/Users/pmital/Developer/mongo-python-driver/test/utils_spec_runner.py", line 529, in run_scenario
          s = client.start_session(**dict(opts))
        File "/Users/pmital/Developer/mongo-python-driver/pymongo/mongo_client.py", line 1797, in start_session
          default_transaction_options=default_transaction_options)
        File "/Users/pmital/Developer/mongo-python-driver/pymongo/mongo_client.py", line 1768, in __start_session
          server_session = self._get_server_session()
        File "/Users/pmital/Developer/mongo-python-driver/pymongo/mongo_client.py", line 1801, in _get_server_session
          return self._topology.get_server_session()
        File "/Users/pmital/Developer/mongo-python-driver/pymongo/topology.py", line 498, in get_server_session
          "Sessions are not supported by this MongoDB deployment")
      pymongo.errors.ConfigurationError: Sessions are not supported by this MongoDB deployment
      

      We need to modify the spec runner so that we can use the same class to run spec tests across MongoDB versions irrespective of server-side support for sessions.

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

              Created:
              Updated:
              Resolved: