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

Fix flaky test in Mongoid::Factory spec

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: Tests
    • None

      There is a test failure that is 99% reproducible via GitHub actions, and sometimes happens locally/on Evergreen.

      2) Mongoid::Factory.from_db when the attributes are nil when model class is an inheritance root sets the attributes to _type only
           Failure/Error: document.attributes.should == {'_type' => 'Address'}
           
             expected: {"_type"=>"Address"}
                  got: {} (using ==)
             Diff:
             @@ -1,2 +1 @@
             -"_type" => "Address",
             
           # ./spec/mongoid/factory_spec.rb:224:in `block (5 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:
            Unassigned Unassigned
            Reporter:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: