-
Couldn't load subscription status.
- Fork 53
Find a Generic way to fix flaky tests #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3d29a97 to
389161e
Compare
When using `--fail-fast` option the rails reporter could raise before other reporters records the failure. Hence we place rails last. Signed-off-by: Ulysse Buonomo <[email protected]>
da22db2 to
2827075
Compare
This test was failing due to missing a column in the model. We fix it by resetting the cache after adding the column. Signed-off-by: Ulysse Buonomo <[email protected]>
cb70966 to
dd3ac0c
Compare
Add `bin/minitest_bisect` to easily bisect with project configurations.
It was using old and invalid SQL statements. I took that opportunity to also change a bit its behaviour: - Remove the related rake task and automatically cache the schema if non-existent. - Cache every databases used in tests. - Ensure that cache name is based on schema files. - Rely on DefaultDB for db manipulations since the others might not exist.
Get one single table with every results from flaky tests.
dd3ac0c to
e061474
Compare
|
@rafiss I would merge that way since we are already fixing the most important flaky tests. And this workflow is the better compromise I found for now (running minitest_bisect in the CI isn't yet properly working). Since rails 8.1 is out, I'd rather merge this, and use it while coding for rails 8.1, and maybe open later a new pr if I find a better workflow. WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since rails 8.1 is out, I'd rather merge this, and use it while coding for rails 8.1, and maybe open later a new pr if I find a better workflow. WDYT?
These changes look very useful! Yes let's merge this.
With the new workflow
flaky.yml, I could see that there are quite a few flaky tests. However, fixing one with my current method is too slow. So This PR is a lab to find a better method. The main ideas for now are:NameError: uninitialized class variable @@already_loaded_fixturesNoMethodError: undefined method '<<' for nilActiveRecord::PreparedStatementCacheExpired: ERROR: cached plan must not change result typeActiveRecord::ConnectionTimeoutError: could not obtain a connection from the pool within 0.200 seconds (waited 0.200 seconds); all pooled connections were in useTimeout::Error: Test took over 5 minutes to finishActiveRecord::Encryption::EncryptableRecordTest#test_forced_encoding_for_deterministic_attributes_will_replace_invalid_charactersCockroachDB::TransactionsTest#test_concurrent_insert_with_processes:Minitest Bisect
Draft board for a GitHub Action based Bisect