From 60c0b08d21aa3db47c09da24cbbbf52061a328f2 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Thu, 23 Sep 2021 15:14:15 +0200 Subject: [PATCH] Maintenance: Work around timeouts caused by the sanitizer in slow CI environments. --- spec/models/channel/email_parser_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/models/channel/email_parser_spec.rb b/spec/models/channel/email_parser_spec.rb index 6b15bffdc..b553db6f3 100644 --- a/spec/models/channel/email_parser_spec.rb +++ b/spec/models/channel/email_parser_spec.rb @@ -1236,6 +1236,12 @@ RSpec.describe Channel::EmailParser, type: :model do end describe 'XSS protection' do + + before do + # XSS processing may run into a timeout on slow CI systems, so turn the timeout off for the test. + stub_const("#{HtmlSanitizer}::PROCESSING_TIMEOUT", nil) + end + let(:article) { described_class.new.process({}, raw_mail).second } let(:raw_mail) { <<~RAW.chomp }