From 0c2ce10d81584292e64ea81203854332958e9f0b Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 16 Sep 2024 14:10:27 -0400 Subject: [PATCH] debug test in ci --- lib/sqlite3/database.rb | 4 ++-- test/test_database.rb | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/sqlite3/database.rb b/lib/sqlite3/database.rb index e3a14d73..97e6e210 100644 --- a/lib/sqlite3/database.rb +++ b/lib/sqlite3/database.rb @@ -153,9 +153,9 @@ def initialize file, options = {}, zvfs = nil # See adr/2024-09-fork-safety.md for more information on fork safety. def close if Process.pid != @owner_pid - warn "WARNING: An open sqlite database connection was inherited from a forked process and " \ + warn "An open sqlite database connection was inherited from a forked process and " \ "is being discarded. This is a memory leak. If possible, please close all sqlite " \ - "database connections before forking." + "database connections before forking.", uplevel: 1 discard else _close diff --git a/test/test_database.rb b/test/test_database.rb index f95c6ebf..6ced7eee 100644 --- a/test/test_database.rb +++ b/test/test_database.rb @@ -749,9 +749,10 @@ def test_close_in_a_new_process_calls_discard_and_warns db.define_singleton_method(:discard) do called = true end - db.instance_variable_set(:@owner_pid, Process.pid + 1) - - assert_output(nil, /WARNING: An open sqlite database connection was inherited from a forked process/) do + db.instance_variable_set(:@owner_pid, 1) + pp db + Kernel.warn "this is a warning" + assert_output(nil, /warning: An open sqlite database connection was inherited from a forked process/) do db.close end assert(called)