Skip to content

Conversation

@BuonOmo
Copy link
Collaborator

@BuonOmo BuonOmo commented Oct 14, 2025

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:

Minitest Bisect

  • isolate a seed that is failing a bit quickly and locally. 38078 seems to be just that (200s locally)
  • find the proper way to start tests that is as close to rake as possible.
  • find a way to not reload the schema every time (maybe with the templatedb option?)
  • debug the non-working ci (it seems like drb is killed at some point for some reason)

Draft board for a GitHub Action based Bisect

@BuonOmo BuonOmo changed the base branch from master to fix/test_create_with_query_cache October 14, 2025 09:02
@BuonOmo BuonOmo force-pushed the fix/flaky-tests-method branch from 3d29a97 to 389161e Compare October 14, 2025 09:22
Base automatically changed from fix/test_create_with_query_cache to master October 14, 2025 20:49
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]>
@BuonOmo BuonOmo force-pushed the fix/flaky-tests-method branch 13 times, most recently from da22db2 to 2827075 Compare October 16, 2025 14:26
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]>
@BuonOmo BuonOmo force-pushed the fix/flaky-tests-method branch 9 times, most recently from cb70966 to dd3ac0c Compare October 24, 2025 14:29
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.
@BuonOmo BuonOmo force-pushed the fix/flaky-tests-method branch from dd3ac0c to e061474 Compare October 24, 2025 14:33
@BuonOmo BuonOmo marked this pull request as ready for review October 24, 2025 14:33
@BuonOmo
Copy link
Collaborator Author

BuonOmo commented Oct 24, 2025

@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?

@BuonOmo BuonOmo requested a review from rafiss October 24, 2025 14:35
Copy link
Contributor

@rafiss rafiss left a 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.

@rafiss rafiss merged commit 9b4ab96 into master Oct 28, 2025
5 checks passed
@BuonOmo BuonOmo deleted the fix/flaky-tests-method branch October 28, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants