Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2617

Do not set method invocation expectations in threads

    • Fully Compatible

      Setting method invocation expectations in threads appears to be racy:

      RSpec::Expectations::ExpectationNotMetError: expected Mongo::Error::OperationFailure with "timeout test", got #<NameError: undefined local variable or method `monotonic_time' for Mongo::Utils:Module
      Did you mean?  monotonic_time> with backtrace:
        # ./lib/mongo/session.rb:390:in `rescue in block in with_transaction'
        # ./lib/mongo/session.rb:381:in `block in with_transaction'
        # ./lib/mongo/session.rb:374:in `loop'
        # ./lib/mongo/session.rb:374:in `with_transaction'
        # ./spec/mongo/session_transaction_spec.rb:163:in `block (6 levels) in <top (required)>'
        # ./spec/mongo/session_transaction_spec.rb:162:in `block (5 levels) in <top (required)>'
        # ./spec/shared/lib/mrss/constraints.rb:71:in `block (2 levels) in max_example_run_time'
        # ./spec/shared/lib/mrss/constraints.rb:70:in `block in max_example_run_time'
        # ./spec/lite_spec_helper.rb:131:in `block (3 levels) in <top (required)>'
        # ./spec/lite_spec_helper.rb:130:in `block (2 levels) in <top (required)>'
        # ./spec/lite_spec_helper.rb:113:in `block (2 levels) in <top (required)>'
        # ./spec/support/background_thread_registry.rb:65:in `block (2 levels) in <top (required)>'
      
      

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: