Skip to content

Commit 36cf7ce

Browse files
aidanharanAidan Haran
andauthored
Load schema and call original test to prevent randomly failing test (#919)
Co-authored-by: Aidan Haran <aharan@fusioneer.com>
1 parent dac40d7 commit 36cf7ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/cases/coerced_tests.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ def test_errors_when_an_insert_query_prefixed_by_a_double_dash_comment_is_called
9797

9898
module ActiveRecord
9999
class AdapterPreventWritesLegacyTest < ActiveRecord::TestCase
100+
# Fix randomly failing test. The loading of the model's schema was affecting the test.
101+
coerce_tests! :test_errors_when_an_insert_query_is_called_while_preventing_writes
102+
def test_errors_when_an_insert_query_is_called_while_preventing_writes_coerced
103+
Subscriber.send(:load_schema!)
104+
original_test_errors_when_an_insert_query_is_called_while_preventing_writes
105+
end
106+
100107
# Fix randomly failing test. The loading of the model's schema was affecting the test.
101108
coerce_tests! :test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes
102109
def test_errors_when_an_insert_query_prefixed_by_a_slash_star_comment_is_called_while_preventing_writes_coerced

0 commit comments

Comments
 (0)