Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5680

Bad interaction between specs leads to failing FLE specs when all specs are run together

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

      When running all specs together (e.g. rake spec), with FLE enabled, two specs in the database_rake_spec.rb file fail with a cryptic error about the "encrypted" client not being defined.

      This can be narrowed down to the following minimal case:

       

      shell> FLE=helper rspec spec/integration/encryption_spec.rb spec/mongoid/clients/options_spec.rb spec/mongoid/tasks/database_rake_spec.rb

      The error apparently happens because the encryption_spec.rb sets up an "encrypted" client, and then options_spec.rb clears all clients, but must be leaving something behind so that when database_rake_spec.rb runs, it gets confused and fails.

      For now, this is worked around by using rake ci (which isolates the specs a bit better) instead of rake spec, but it would be better to clean up the specs eventually so that we don't leak side-effects like this.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: