From 1560e6a5d6a16fab458f9e00c3995a4337831cda Mon Sep 17 00:00:00 2001 From: eileencodes Date: Wed, 5 Jul 2023 15:40:43 -0400 Subject: [PATCH] Fix flaky time test A combination of 3 tests using the `Topic` model and working with timezones would cause the time test to fail. I noticed that one of the tests required to reproduce changes the configured timezone for `Topic` but doesn't reset column information. Adding that fixes the flaky test. Fixes #48664 --- activerecord/test/cases/yaml_serialization_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb index d4d1b93ee9079..a895ab9e1b5f6 100644 --- a/activerecord/test/cases/yaml_serialization_test.rb +++ b/activerecord/test/cases/yaml_serialization_test.rb @@ -14,6 +14,8 @@ def test_to_yaml_with_time_with_zone_should_not_raise_exception topic = Topic.new(written_on: DateTime.now) assert_nothing_raised { topic.to_yaml } end + ensure + Topic.reset_column_information end def test_roundtrip