diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/support/helpers/stub_requests.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/support/helpers/stub_requests.rb')
-rw-r--r-- | spec/support/helpers/stub_requests.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/helpers/stub_requests.rb b/spec/support/helpers/stub_requests.rb index a3810323fee..bde5535705e 100644 --- a/spec/support/helpers/stub_requests.rb +++ b/spec/support/helpers/stub_requests.rb @@ -18,9 +18,15 @@ module StubRequests end def stub_dns(url, ip_address:, port: 80) + debug_with_puts "beginning of stub_dns" url = parse_url(url) + debug_with_puts "before socket = Socket.sockaddr_in" socket = Socket.sockaddr_in(port, ip_address) + debug_with_puts "after socket = Socket.sockaddr_in" + + debug_with_puts "before addr = Addrinfo.new(socket)" addr = Addrinfo.new(socket) + debug_with_puts "after addr = Addrinfo.new(socket)" # See Gitlab::UrlBlocker allow(Addrinfo).to receive(:getaddrinfo) @@ -52,4 +58,12 @@ module StubRequests def parse_url(url) url.is_a?(URI) ? url : URI(url) end + + # TODO: Remove the debug_with_puts statements below! Used for debugging purposes. + # TODO: https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/issues/323#note_1688925316 + def debug_with_puts(message) + return unless ENV['CI'] # rubocop:disable RSpec/AvoidConditionalStatements -- Debug information only in the CI + + puts "[#{Time.current}] #{message}" + end end |