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

Fix flaky test in Mongoid::Contextual::Mongo specs

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 7.3.3
    • Affects Version/s: None
    • Component/s: None

      There is a flaky spec in Mongoid :

      Mongoid::Contextual::Mongo#each when no block is provided when iterating over the enumerator when iterating with next does not load all documents

      1) Mongoid::Contextual::Mongo#each when no block is provided when iterating over the enumerator when iterating with next does not load all documents
         Failure/Error: expect(Mongo::Logger.logger).to receive(:debug?).exactly(2).times.and_call_original
         
           (#<Logger:0x0000560a2f6043b8 @level=1, @progname=nil, @default_formatter=#<Logger::Formatter:0x0000560a2f604390 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x0000560a2f604340 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x0000560a2f604318>, @mon_data_owner_object_id=4280>>).debug?(*(any args))
               expected: 2 times with any arguments
               received: 4 times with any arguments
         # ./spec/mongoid/contextual/mongo_spec.rb:643:in `block (6 levels) in <top (required)>'
         # ./spec/lite_spec_helper.rb:68:in `block (3 levels) in <top (required)>'
         # ./spec/lite_spec_helper.rb:67:in `block (2 levels) in <top (required)>'
      

            Assignee:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Reporter:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: