Skip to content

Commit bfbf696

Browse files
authored
Merge pull request rails#38928 from jonathanhefner/fix-limit-count-test-non-determinism
Fix random CI fail due to non-deterministic order
2 parents 2998672 + 5b28e42 commit bfbf696

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/test/cases/calculations_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ def test_should_limit_calculation_with_offset
169169
end
170170

171171
def test_limit_should_apply_before_count
172-
accounts = Account.limit(4)
172+
accounts = Account.order(:id).limit(4)
173173

174174
assert_equal 3, accounts.count(:firm_id)
175175
assert_equal 3, accounts.select(:firm_id).count
176176
end
177177

178178
def test_limit_should_apply_before_count_arel_attribute
179-
accounts = Account.limit(4)
179+
accounts = Account.order(:id).limit(4)
180180

181181
firm_id_attribute = Account.arel_table[:firm_id]
182182
assert_equal 3, accounts.count(firm_id_attribute)

0 commit comments

Comments
 (0)