Skip to content

Unskip test to check that listener can take prefix from search_path#859

Merged
brandur merged 1 commit intomasterfrom
brandur-test-listener-search-path
Apr 28, 2025
Merged

Unskip test to check that listener can take prefix from search_path#859
brandur merged 1 commit intomasterfrom
brandur-test-listener-search-path

Conversation

@brandur
Copy link
Contributor

@brandur brandur commented Apr 26, 2025

The change in #848 added a capability to the listener so that in case a
schema is not explicitly provided, it can be detected from
search_path so that multiple Rivers could share a database as long as
their search paths are configured correctly.

This was tricky to test though because listeners acquire their own
connections, and we don't want to set search path on the database pool
because it'd taint a connection on it and we wouldn't be guaranteed to
get that connection for the listener anyway. I marked the test case as
skipped until I could go and look at it again.

Here, add a function to listeners that causes them to invoke an SQL
command after a connection is acquired. This should only be used in
tests, but lets us check this case. It's a little gnarly to be sure, but
the river driver interface is explicitly marked as unstable, and I can't
think of any alternatives that aren't worse.

The change in #848 added a capability to the listener so that in case a
schema is _not_ explicitly provided, it can be detected from
`search_path` so that multiple Rivers could share a database as long as
their search paths are configured correctly.

This was tricky to test though because listeners acquire their own
connections, and we don't want to set search path on the database pool
because it'd taint a connection on it and we wouldn't be guaranteed to
get that connection for the listener anyway. I marked the test case as
skipped until I could go and look at it again.

Here, add a function to listeners that causes them to invoke an SQL
command after a connection is acquired. This should only be used in
tests, but lets us check this case. It's a little gnarly to be sure, but
the river driver interface is explicitly marked as unstable, and I can't
think of any alternatives that aren't worse.
@brandur brandur requested a review from bgentry April 26, 2025 09:32
Copy link
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems perfectly fine for now, thanks!

@brandur brandur merged commit 3377aff into master Apr 28, 2025
19 of 20 checks passed
@brandur brandur deleted the brandur-test-listener-search-path branch April 28, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants