From 5cdb6232c40ba0e409806d437aff9879943efd10 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Fri, 23 Oct 2026 08:56:40 +0200 Subject: [PATCH] Skip 3 specs on 32 bit architectures because they fail with NoMemoryError there. Fixes #756 --- spec/helpers.rb | 2 ++ spec/pg/connection_spec.rb | 2 +- spec/pg/type_spec.rb | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/helpers.rb b/spec/helpers.rb index 951ca099b..28f7a4640 100644 --- a/spec/helpers.rb +++ b/spec/helpers.rb @@ -11,6 +11,7 @@ require_relative 'helpers/tcp_gate_scheduler' require_relative 'helpers/tcp_gate_switcher' require_relative 'helpers/tcp_gate_switcher_process' +require 'rbconfig/sizeof' TEST_DIRECTORY = Pathname.new(ENV['RUBY_PG_TEST_DIR'] || Dir.pwd) DATA_OBJ_MEMSIZE = ObjectSpace.memsize_of(Object.new) @@ -691,6 +692,7 @@ def set_etc_hosts(hostaddr, hostname) rescue LoadError config.filter_run_excluding( :bigdecimal ) end + config.filter_run_excluding( :arch64 ) if RbConfig::SIZEOF["void*"] < 8 ### Automatically set up and tear down the database config.before(:suite) do |*args| diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb index 05e373e89..5f2d8c127 100644 --- a/spec/pg/connection_spec.rb +++ b/spec/pg/connection_spec.rb @@ -2916,7 +2916,7 @@ def wait_check_socket(conn) end end - it "should encode big strings with typecasting without overflow" do + it "should encode big strings with typecasting without overflow", :arch64 do big_count = 100 step = 42_949_673 big_len = (step - 3) / 2 diff --git a/spec/pg/type_spec.rb b/spec/pg/type_spec.rb index ce2e01fd9..91336be6a 100644 --- a/spec/pg/type_spec.rb +++ b/spec/pg/type_spec.rb @@ -1375,7 +1375,7 @@ def expect_deprecated_coder_init expect( v ).to eq( "Héllo\n".encode(Encoding::ISO_8859_1) ) end - it "should encode big strings without crash" do + it "should encode big strings without crash", :arch64 do skip if RUBY_ENGINE=="truffleruby" n = 1 << 30 small = "A" * 100 @@ -1459,7 +1459,7 @@ def expect_deprecated_coder_init expect( v.b ).to eq( "\x00\x01\x00\x00\x00\x05H\xE9llo".b ) end - it "should encode big strings without crash" do + it "should encode big strings without crash", :arch64 do skip if RUBY_ENGINE=="truffleruby" n = 2_147_483_644 wrapped = ((n + 4 + (1 << 31)) % (1 << 32)) - (1 << 31)