about summary refs log tree commit homepage
path: root/test/test_extras_try_gzip_static.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-05-01 19:42:22 +0000
committerEric Wong <e@80x24.org>2018-05-01 22:26:18 +0000
commitc2a0658fc26467a3950bb2848948932ae4f33f61 (patch)
tree0e7b176bdd9a328d46d9ee68b894f32ffd5b8300 /test/test_extras_try_gzip_static.rb
parentfc10a4c09318a1402e5f9f1c770b1f772c12def0 (diff)
downloadyahns-c2a0658fc26467a3950bb2848948932ae4f33f61.tar.gz
We can't require 'proxy_pass' in both a parent and forked child,
so require it up front (as kcar will become a hard dependency
in place of unicorn).

Then, rely on GTL (global test lock) to synchronize around fork
since the VM may not always be able to protect that.

However, there's no need to synchronize around
spawn/system/`backtick`, as the VM should always be using those
in a thread-safe way (via vfork).
Diffstat (limited to 'test/test_extras_try_gzip_static.rb')
-rw-r--r--test/test_extras_try_gzip_static.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_extras_try_gzip_static.rb b/test/test_extras_try_gzip_static.rb
index b6d5943..5901c9d 100644
--- a/test/test_extras_try_gzip_static.rb
+++ b/test/test_extras_try_gzip_static.rb
@@ -52,7 +52,7 @@ class TestExtrasTryGzipStatic < Testcase
       File.symlink "COPYING", "#{tmpdir}/COPYING.relsymlink"
       gplgz = "#{tmpdir}/COPYING.gz"
       FileUtils.cp("COPYING", gpl)
-      _, status = Process.waitpid2(fork do
+      _, status = Process.waitpid2(xfork do
         File.open(gplgz, "w") do |fp|
           Zlib::GzipWriter.wrap(fp.dup) { |io| io.write(GPL_TEXT) }
         end