Project

General

Profile

Patch #43130 ยป Fix-random-test-failures-by-calling-Setting.clear_cache-after-all-tests.diff

Katsuya HIDAKA, 2025-08-12 20:31

View differences:

test/functional/reactions_controller_test.rb
@request.session[:user_id] = users(:users_002).id
end
teardown do
Setting.clear_cache
end
test 'create for issue' do
issue = issues(:issues_002)
test/functional/settings_controller_test.rb
@request.session[:user_id] = 1 # admin
end
def teardown
Setting.delete_all
Setting.clear_cache
end
def test_index
get :index
assert_response :success
test/functional/sys_controller_test.rb
Setting.enabled_scm = %w(Subversion Git)
end
def teardown
Setting.clear_cache
end
def test_projects_with_repository_enabled
get :projects
assert_response :success
test/helpers/reactions_helper_test.rb
Setting.reactions_enabled = '1'
end
teardown do
Setting.clear_cache
end
test 'reaction_id_for generates a DOM id' do
assert_equal "reaction_issue_1", reaction_id_for(issues(:issues_001))
end
test/test_helper.rb
self.use_transactional_tests = true
self.use_instantiated_fixtures = false
# Clear Settings cache after each test to prevent test interference
teardown do
Setting.clear_cache
end
def uploaded_test_file(name, mime)
fixture_file_upload(name.to_s, mime, true)
end
test/unit/lib/redmine/reaction_test.rb
Setting.reactions_enabled = '1'
end
teardown do
Setting.clear_cache
end
test 'preload_reaction_details preloads ReactionDetail for all objects in the collection' do
User.current = users(:users_002)
test/unit/mail_handler_test.rb
User.current = nil
end
def teardown
Setting.clear_cache
end
def test_add_issue_with_specific_overrides
issue =
submit_email(
test/unit/setting_test.rb
User.current = nil
end
def teardown
Setting.delete_all
Setting.clear_cache
end
def test_read_default
Setting.delete_all
Setting.clear_cache
assert_equal "Redmine", Setting.app_title
assert Setting.self_registration?
assert !Setting.login_required?
......
assert_equal 'UTF-8', Setting.commit_update_keywords.first['keywords'].encoding.name
ensure
Setting.where(:name => 'commit_update_keywords').delete_all
Setting.clear_cache
end
def test_mail_from_format_should_be_validated
    (1-1/1)