Browse Source

Maintenance: Stabilize time helper tests to avoid race conditions.

Martin Gruner 1 year ago
parent
commit
412007e7f9
1 changed files with 3 additions and 0 deletions
  1. 3 0
      spec/support/time_helper.rb

+ 3 - 0
spec/support/time_helper.rb

@@ -5,6 +5,9 @@ module TimeHelperCache
     define_method method_name do |*args, **kwargs, &blk|
       super(*args, **kwargs, &blk).tap do
         Rails.cache.clear
+      rescue Errno::EISDIR
+        # suppress race condition errors
+      ensure
         Setting.class_variable_set :@@last_changed_at, 1.second.ago # rubocop:disable Style/ClassVars
       end
     end