From 5d2e43baee322247750877fa11ad2673dd75df64 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Mon, 12 Oct 2026 14:13:28 +0900 Subject: [PATCH] Use ::1 as the unreachable address in webhook executor tests to avoid 60-second connection timeouts on macOS --- test/unit/webhook_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/webhook_test.rb b/test/unit/webhook_test.rb index 662ec8d61..268b9ba6e 100644 --- a/test/unit/webhook_test.rb +++ b/test/unit/webhook_test.rb @@ -349,8 +349,8 @@ class WebhookTest < ActiveSupport::TestCase test "executor tries the next IP when a connection fails" do with_webhook_server do |port, received| executor = Webhook::Executor.new("http://127.0.0.1:#{port}/hook", 'payload', nil) - # nothing listens on 127.0.0.2:, so the first connection is refused - executor.stubs(:valid_ips).returns(['127.0.0.2', '127.0.0.1']) + # nothing listens on [::1]:, so the first connection fails immediately + executor.stubs(:valid_ips).returns(['::1', '127.0.0.1']) response = executor.call @@ -362,7 +362,7 @@ class WebhookTest < ActiveSupport::TestCase test "executor raises a SocketError when no IP can be connected to" do with_webhook_server do |port, received| executor = Webhook::Executor.new("http://127.0.0.1:#{port}/hook", 'payload', nil) - executor.stubs(:valid_ips).returns(['127.0.0.2']) + executor.stubs(:valid_ips).returns(['::1']) error = assert_raises(SocketError) { executor.call } assert_equal 'Could not connect to any IP', error.message -- 2.55.0