aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-12-15 11:08:57 +0900
committerYuji Yaginuma <yuuji.yaginuma@gmail.com>2017-12-15 11:57:43 +0900
commitcc0d272c8c37c197a7e68633e5f082eccb2e3737 (patch)
tree212accba632fb74cab181ef668d8207277e78947 /actionpack/test
parent67b9dbcc1cfce6694ab18c9629b233979506fbf0 (diff)
downloadrails-cc0d272c8c37c197a7e68633e5f082eccb2e3737.tar.gz
rails-cc0d272c8c37c197a7e68633e5f082eccb2e3737.tar.bz2
rails-cc0d272c8c37c197a7e68633e5f082eccb2e3737.zip
Generate tmpname on its own
`make_tmpname` was removed by https://github.com/ruby/ruby/commit/25d56ea7b7b52dc81af30c92a9a0e2d2dab6ff27. In this case, we want a file name, not a `File`. So cannot use `Tempfile`. Fixes #31458
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 55ad9c245e..deffa63e12 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -380,7 +380,7 @@ class ForkingExecutor
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
@@ -422,6 +422,11 @@ class ForkingExecutor
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