From f26d53e90533232ac35ca0eae2ca7766c2af5ebb Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 25 Oct 2023 20:37:21 +0900 Subject: Reduce the number of times IO is passed in send_io/recv_io test Since Linux 4.5, sendmsg(2) fails with ETOOMANYREFS if the number of "in-flight" IOs, which has been sent by sendmsg(2) but has not yet accepted by recvmsg(2), exceeds the RLIMIT_NOFILE resource limit. https://rubyci.s3.amazonaws.com/arm64-neoverse-n1/ruby-master/log/20231025T090004Z.fail.html.gz ``` 1) Error: TestSocket_UNIXSocket#test_fd_passing_race_condition: Errno::ETOOMANYREFS: Too many references: cannot splice - sendmsg(2) ``` This change reduces the number of times of IO passing under 1024, which is a default limit in many environments. --- test/socket/test_unix.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 135d32739d..3e7d85befc 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -152,7 +152,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase lock = Thread::Mutex.new nr = 0 x = 2 - y = 1000 + y = 400 begin s1.send_io(nil) rescue NotImplementedError @@ -167,12 +167,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase true end end - begin - (x * y).times { s1.send_io r1 } - rescue Errno::ETOOMANYREFS => e - # for arm64-neoverse-n1 - omit e.message - end + (x * y).times { s1.send_io r1 } assert_equal([true]*x, thrs.map { |t| t.value }) assert_equal x * y, nr ensure -- cgit v1.2.3