summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-15 04:40:14 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-15 04:40:14 +0000
commit05da6568c2aec52a6dc60ee29faa07692682c9a2 (patch)
tree369b2e42e325114549f1d45cb8057d104fdc0b6b /test
parent347ed2116ca9e9e45c7563a5615c048f83c904a8 (diff)
test/lib/test/unit.rb: do not propagate MAKEFLAGS to children
Propagating MAKEFLAGS to children running test/unit caused stuck tests with GNU make when "-jN" is passed in both the make(1) command-line and the "TESTS=" variable; because the forked child process would see MAKEFLAGS and try to use jobserver on its own. This is regression caused by r64399 (commit b53fadfd5f200dbd6fe9f4b2a91ebb68618e59bb, "process.c: defaults to close_others false"); but that change also fixed a regression when close-on-exec became the default in 2.0 :< git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/lib/test/unit.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 3f74c7f5e28..35751208a9d 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -136,8 +136,9 @@ module Test
def non_options(files, options)
@jobserver = nil
+ makeflags = ENV.delete("MAKEFLAGS")
if !options[:parallel] and
- /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
+ /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ makeflags
begin
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)