Skip to content

Close the superuser transaction before the security tests' teardown - #939

Merged
sfc-gh-agedemenli merged 1 commit into
mainfrom
agedemenli/test-security-teardown
Nov 26, 2026
Merged

sfc-gh-agedemenli merged 1 commit into
mainfrom
agedemenli/test-security-teardown

Conversation

@sfc-gh-agedemenli

Copy link
Copy Markdown
Collaborator

test_dollar_quote_injection_in_location_does_not_escalate_privileges ends with a query on superuser_conn, which leaves a transaction open. When it is the last test of test_security.py that a CI shard runs, the module fixture's teardown fails with set_session cannot be used inside a transaction, as in #933, whose new tests moved it to the end of a shard. The teardown now rolls back first.

Running that test alone reproduces it; with this change it passes, as does the whole file.

test_dollar_quote_injection_in_location_does_not_escalate_privileges ends
with a query on superuser_conn, which leaves a transaction open. When it is
the last test of the module that a CI shard runs, the module fixture's
teardown fails to set autocommit inside that transaction. Roll back first.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ahmet Gedemenli <ahmet.gedemenli@snowflake.com>
@sfc-gh-agedemenli
sfc-gh-agedemenli merged commit 896b997 into main Nov 26, 2026
174 of 175 checks passed
@sfc-gh-agedemenli
sfc-gh-agedemenli deleted the agedemenli/test-security-teardown branch November 26, 2026 03:19
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