Skip to content

Fix a flaky test in query_assertions_test.rb#50503

Merged
dhh merged 1 commit intorails:mainfrom
fatkodima:fix-flaky-query_assertions-test
Jan 2, 2024
Merged

Fix a flaky test in query_assertions_test.rb#50503
dhh merged 1 commit intorails:mainfrom
fatkodima:fix-flaky-query_assertions-test

Conversation

@fatkodima
Copy link
Member

@fatkodima fatkodima commented Dec 31, 2023

Fixes a flaky test from https://buildkite.com/rails/rails/builds/103104#018cbef2-ddda-4c0d-b30d-70d5d55cff93

To reproduce:

$ rake test:postgresql SEED=64665

I wasn't able to reduce it and to find the exact preceding test case that makes this test to fail. Seems like somewhere the connection is reset/etc and so is reestablished in this test case and thus generates extra queries.

Changing this test case to be less strict makes it pass.

@fatkodima fatkodima force-pushed the fix-flaky-query_assertions-test branch from 8733df3 to 15a00c7 Compare December 31, 2023 17:50
@fatkodima
Copy link
Member Author

fatkodima commented Dec 31, 2023

Additionally fixed another similar flaky test - https://buildkite.com/rails/rails/builds/103109#018cc0e2-6170-4743-b8b6-e86765d64361

@zzak zzak added the ci issues label Jan 2, 2024
@dhh dhh merged commit 2edf4a7 into rails:main Jan 2, 2024
@fatkodima fatkodima deleted the fix-flaky-query_assertions-test branch January 2, 2024 11:57
dhh added a commit that referenced this pull request Jan 2, 2024
* main:
  Fix test
  Allow overriding SQLite defaults from `database.yml` (#50460)
  Fix a flaky test in `query_assertions_test.rb` (#50503)
  Document apply_rubocop_autocorrect_after_generate! in configuration guide (#50532)
  bundle update rubocop --conservative (#50515)
yoones pushed a commit to yoones/rails that referenced this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants