1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Address test_statement_cache_with_in_clause failure due to nondeterministic sort order

This failure is occasional, does not always reproduce.

```ruby
$ cd activerecord
$ bundle exec rake test_postgresql
... snip ...

....F

Failure:
ActiveRecord::BindParameterTest#test_statement_cache_with_in_clause [/home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:97]:
Expected: [1, 3]
  Actual: [3, 1]

rails test home/yahonda/git/rails/activerecord/test/cases/bind_parameter_test.rb:93

```
This commit is contained in:
Yasuo Honda 2019-06-20 14:12:58 +00:00
parent e14f3f3c11
commit 688da62a4c

View file

@ -93,7 +93,7 @@ if ActiveRecord::Base.connection.prepared_statements
def test_statement_cache_with_in_clause
@connection.clear_cache!
topics = Topic.where(id: [1, 3])
topics = Topic.where(id: [1, 3]).order(:id)
assert_equal [1, 3], topics.map(&:id)
assert_not_includes statement_cache, to_sql_key(topics.arel)
end