From dbc925f2bf204cd4d46772095d45145d6eb942bd Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 6 Jan 2018 09:01:02 +0000 Subject: [PATCH] test_process.rb: skip not-found groups * test/ruby/test_process.rb (test_execopts_gid): under some network configuration (maybe with Open Directory but disconnected temporarily), some groups may fail to find. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 28a2f05a85..5eaf9162c7 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1850,7 +1850,12 @@ class TestProcess < Test::Unit::TestCase skip "Process.groups not implemented on Windows platform" if windows? feature6975 = '[ruby-core:47414]' - [30000, *Process.groups.map {|g| g = Etc.getgrgid(g); [g.name, g.gid]}].each do |group, gid| + groups = Process.groups.map do |g| + g = Etc.getgrgid(g) rescue next + [g.name, g.gid] + end + groups.compact! + [30000, *groups].each do |group, gid| assert_nothing_raised(feature6975) do begin system(*TRUECOMMAND, gid: group)