ruby-changes:66274
From: Nobuyoshi <ko1@a...>
Date: Thu, 20 May 2021 21:57:18 +0900 (JST)
Subject: [ruby-changes:66274] c711093559 (master): Get rid of sporadic WSAEACCES on Windows
https://git.ruby-lang.org/ruby.git/commit/?id=c711093559 From c71109355987f290257e977c1634db6328916786 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 20 May 2021 20:15:43 +0900 Subject: Get rid of sporadic WSAEACCES on Windows [ruby-dev:42661] --- test/socket/test_socket.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb index 9cef9f0..77ce093 100644 --- a/test/socket/test_socket.rb +++ b/test/socket/test_socket.rb @@ -163,7 +163,12 @@ class TestSocket < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_socket.rb#L163 def random_port # IANA suggests dynamic port for 49152 to 65535 # http://www.iana.org/assignments/port-numbers - 49152 + rand(65535-49152+1) + case RUBY_PLATFORM + when /mingw|mswin/ + rand(50000..65535) + else + rand(49152..65535) + end end def errors_addrinuse -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/