human-essentials
human-essentials copied to clipboard
[BUG]: Flaky test spec/events/event_differ_spec.rb:16
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
spec/events/event_differ_spec.rb:16
sometimes fails
1) EventDiffer should return a full diff
Failure/Error:
expect(results.as_json).to contain_exactly(
{"aggregate" => false,
"database" => true,
"storage_location_id" => storage_location3.id,
:type => "location"},
{"aggregate" => true,
"database" => false,
"storage_location_id" => StorageLocation.count + 1,
:type => "location"},
{"aggregate" => 0,
expected collection contained: [{"aggregate"=>false, "database"=>true, "storage_location_id"=>3, :type=>"location"}, {"aggregate"=>t...>"item"}, {"aggregate"=>60, "database"=>50, "item_id"=>93, "storage_location_id"=>5, :type=>"item"}]
actual collection contained: [{"aggregate"=>false, "database"=>true, "storage_location_id"=>3, :type=>"location"}, {"aggregate"=>0...>"item"}, {"aggregate"=>60, "database"=>50, "item_id"=>93, "storage_location_id"=>5, :type=>"item"}]
the missing elements were: [{"aggregate"=>true, "database"=>false, "storage_location_id"=>4, :type=>"location"}, {"aggregate"=>70, "database"=>0, "item_id"=>95, "storage_location_id"=>4, :type=>"item"}]
the extra elements were: [{"aggregate"=>0, "database"=>50, "item_id"=>93, "storage_location_id"=>4, :type=>"item"}]
# ./spec/events/event_differ_spec.rb:44:in `block (2 levels) in <top (required)>'
Failed examples:
rspec ./spec/events/event_differ_spec.rb:16 # EventDiffer should return a full diff
https://github.com/rubyforgood/human-essentials/actions/runs/7979190744/job/21786023826?pr=4114
Expected Behavior
the test should pass
Code of Conduct
- [X] I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community