From 05da6568c2aec52a6dc60ee29faa07692682c9a2 Mon Sep 17 00:00:00 2001 From: normal Date: Sat, 15 Dec 2018 04:40:14 +0000 Subject: 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 --- test/lib/test/unit.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/lib') diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb index 3f74c7f5e2..35751208a9 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) -- cgit v1.2.3