Skip to content

Commit fcddaa7

Browse files
cardmagicclaude
andcommitted
test: prove the probe notifies from another connection
The TypeScript suite covers this and the Ruby suite did not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 4dd6886 commit fcddaa7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎test/integration/wake_up_selection_test.rb‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@ def wait(timeout:) = false
178178
end
179179
end
180180

181+
test "a listener wakes from a notification sent on another connection" do
182+
skip unless database_family == :postgresql
183+
channel = "solid_objects_probe_parity"
184+
adapter = SolidObjects::WakeUpAdapters::Postgresql.new(channel:)
185+
186+
assert adapter.listen
187+
SolidObjects::Record.connection_pool.with_connection do |connection|
188+
connection.execute("NOTIFY #{connection.quote_table_name(channel)}")
189+
end
190+
191+
assert adapter.wait(timeout: 2.0)
192+
ensure
193+
adapter&.stop
194+
end
195+
181196
test "a database without a channel polls and reports its floor" do
182197
skip if database_family == :postgresql
183198

0 commit comments

Comments
 (0)