Rails 6.1: Fix randomly failing prevent writes test #912
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix some randomly failing tests. The tests fail because the table schema is sometimes queried for if the schema is not already loaded. The tests rely on the number of queries being performed and so the schema loading queries throw off the tests.
Example of
ActiveRecord::AdapterPreventWritesLegacyTest#test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
failing:https://pipelines.actions.githubusercontent.com/OGQvFf2eDbGUprKdJ5qsq3TsAFLfKWDWAJCyTHn8ess0fbvp0X/_apis/pipelines/1/runs/172/signedlogcontent/6?urlExpires=2021-04-22T14%3A43%3A54.2983268Z&urlSigningMethod=HMACV1&urlSignature=1puWUyN%2Fxlx7jqGDOQjHpgDOQG9SfPBtfCS4J4WdB6I%3D
Example of
ActiveRecord::AdapterPreventWritesTest#test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called_while_preventing_writes
failing:https://pipelines.actions.githubusercontent.com/OGQvFf2eDbGUprKdJ5qsq3TsAFLfKWDWAJCyTHn8ess0fbvp0X/_apis/pipelines/1/runs/174/signedlogcontent/5?urlExpires=2021-04-22T15%3A18%3A22.8253096Z&urlSigningMethod=HMACV1&urlSignature=FY2PmomDAdBmXJ4EdcuTaVrhq7foyh%2BM38MrnA9zXa8%3D