Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate tmpname on its own #31462

Merged
merged 1 commit into from Dec 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion actionpack/test/abstract_unit.rb
Expand Up @@ -380,7 +380,7 @@ def pop; @queue.pop; end
def initialize(size)
@size = size
@queue = Server.new
file = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname("rails-tests", "fd")
file = File.join Dir.tmpdir, tmpname
@url = "drbunix://#{file}"
@pool = nil
DRb.start_service @url, @queue
Expand Down Expand Up @@ -422,6 +422,11 @@ def translate_exceptions(result)
end
}
end

def tmpname
t = Time.now.strftime("%Y%m%d")
"rails-tests-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}-fd"
end
end

if RUBY_ENGINE == "ruby" && PROCESS_COUNT > 0
Expand Down