Skip to content
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

Fix flaky db warnings test #50149

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Conversation

fatkodima
Copy link
Member

Comment on lines 86 to 87
ensure
Post.where(id: row_id).delete_all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file does not include require "models/post", so we would also need to add that to use Post.

But this test seems like the odd one out. All the other tests use SELECT 1 + "foo", even the "db_warnings_action allows a list of warnings to ignore" right above. So why don't we make this test match the others instead?

  test "db_warnings_action allows a list of codes to ignore" do
    with_db_warnings_action(:raise, ["1292"]) do
      result = @connection.execute('SELECT 1 + "foo"')

      assert_equal [1], result.to_a.first
    end
  end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed.

@jonathanhefner jonathanhefner merged commit c209fb3 into rails:main Nov 23, 2023
4 checks passed
@jonathanhefner
Copy link
Member

Thank you, @fatkodima! 🧪

@fatkodima fatkodima deleted the fix-flaky-test branch November 23, 2023 17:40
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.

None yet

2 participants