summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-11-09 00:22:25 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-11-09 00:25:28 +0900
commit9deca1a3b91271159e164188367f003978737f42 (patch)
tree8a68aa889fc82b23a81bfb28519901d8cce8a2b9 /spec
parent88b9a0f7fe664098177f4d2f10aed08c4a42b03e (diff)
Try to fix test-spec failure on macOS
Not sure what is happening, but spec/ruby/security/cve_2018_6914_spec.rb fails on macOS. https://github.com/ruby/ruby/runs/294462511#step:10:134 I suspect that the state of a directory is weird immediately after it is created (not writable or even world writable?). This change tries to make sure that ENV["TMPDIR"] is actually used by Dir.tmpdir.
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/security/cve_2018_6914_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/security/cve_2018_6914_spec.rb b/spec/ruby/security/cve_2018_6914_spec.rb
index dc2f2cd095..3cebff2395 100644
--- a/spec/ruby/security/cve_2018_6914_spec.rb
+++ b/spec/ruby/security/cve_2018_6914_spec.rb
@@ -9,6 +9,14 @@ describe "CVE-2018-6914 is resisted by" do
@dir = tmp("CVE-2018-6914")
Dir.mkdir(@dir)
ENV['TMPDIR'] = @dir
+
+ # Make sure that ENV["TMPDIR"] is used by Dir.tmpdir
+ # https://github.com/ruby/ruby/runs/294462511#step:10:134
+ 10.times do
+ break if Dir.tmpdir == File.expand_path(@dir)
+ sleep 0.1
+ end
+
@dir << '/'
@tempfile = nil