Skip to content

Commit

Permalink
Reduce # of opened files in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fatkodima authored and mperham committed Feb 12, 2023
1 parent 8e31758 commit 47b3dde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sidekiq/web/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def strings(lang)
# so extensions can be localized
@strings[lang] ||= settings.locales.each_with_object({}) do |path, global|
find_locale_files(lang).each do |file|
strs = YAML.safe_load(File.open(file))
strs = YAML.safe_load(File.read(file))
global.merge!(strs[lang])
end
end
Expand Down
3 changes: 2 additions & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
end

ENV["REDIS_URL"] ||= "redis://localhost/15"
NULL_LOGGER = Logger.new(IO::NULL)

def reset!
# tidy up any open but unreferenced Redis connections so we don't run out of file handles
Expand All @@ -35,7 +36,7 @@ def reset!

RedisClient.new(url: ENV["REDIS_URL"]).call("flushall")
cfg = Sidekiq::Config.new
cfg.logger = ::Logger.new("/dev/null")
cfg.logger = NULL_LOGGER
cfg.logger.level = Logger::WARN
Sidekiq.instance_variable_set :@config, cfg
cfg
Expand Down

0 comments on commit 47b3dde

Please sign in to comment.