From 75ec5e3655fff0f6c21646738410174d2e103818 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Wed, 19 Aug 2026 07:54:22 +0200 Subject: [PATCH] CI: Improve failure rate of CI runs --- ext/extconf.rb | 6 ++++++ spec/helpers.rb | 2 +- spec/pg/connection_spec.rb | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ext/extconf.rb b/ext/extconf.rb index 99207d234..846436d8a 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -64,6 +64,12 @@ def cook_and_activate self.activate self end + + # Increase number of download retries; otherwise it fails often in CI + alias download_file_count_3 download_file + def download_file(url, full_path, count = 60) + download_file_count_3(url, full_path, count) + end end openssl_platform = with_config("openssl-platform") diff --git a/spec/helpers.rb b/spec/helpers.rb index bba0eeb86..015eccd07 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -684,7 +684,7 @@ def set_etc_hosts(hostaddr, hostname) config.filter_run_excluding( :scheduler ) if RUBY_VERSION < "3.0" || (RUBY_PLATFORM =~ /mingw|mswin/ && RUBY_VERSION < "3.1") || !Fiber.respond_to?(:scheduler) config.filter_run_excluding( :scheduler_address_resolve ) if RUBY_VERSION < "3.1" config.filter_run_excluding( :ipv6 ) if Addrinfo.getaddrinfo("localhost", nil, nil, :STREAM).size < 2 - config.filter_run_excluding( :ractor ) unless defined?(Ractor) + config.filter_run_excluding( :ractor ) unless defined?(Ractor) && RUBY_VERSION >= "4" begin PG.require_bigdecimal_without_warning rescue LoadError diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb index d587721b3..6ed2c5112 100644 --- a/spec/pg/connection_spec.rb +++ b/spec/pg/connection_spec.rb @@ -3089,7 +3089,11 @@ def with_std_conf_strings(conn, onoff) https://www.postgresql.org/docs/current/sql-syntax-lexical.html. Should you find any syntax changes in string literals - please adjust PG::Connection::PLACEHOLDER_RE constant accordingly TEXT - expect(latest_commit_info.dig(0, :sha)).to eq("45762084545ec14dbbe66ace1d69d7e89f8978ac"), error_message + expect(latest_commit_info).to be_kind_of(Array), latest_commit_info.to_s + expect(latest_commit_info[0]).to be_kind_of(Hash), latest_commit_info.to_s + expect(latest_commit_info[0][:sha]).to eq("45762084545ec14dbbe66ace1d69d7e89f8978ac"), error_message + rescue SocketError, JSON::ParserError => err + skip "cannot access PostgreSQL git repository: #{err}" end describe "default type map" do