Skip to content

[PECOBLR-2086] Add comprehensive MST transaction metadata and edge case tests#765

Open
vikrantpuppala wants to merge 2 commits intodatabricks:mainfrom
vikrantpuppala:add-mst-transaction-tests
Open

[PECOBLR-2086] Add comprehensive MST transaction metadata and edge case tests#765
vikrantpuppala wants to merge 2 commits intodatabricks:mainfrom
vikrantpuppala:add-mst-transaction-tests

Conversation

@vikrantpuppala
Copy link
Copy Markdown
Contributor

Summary

  • Adds comprehensive E2E transaction tests to tests/e2e/test_transactions.py covering gaps identified in the MST + xDBC Metadata RPCs audit
  • Removes @pytest.mark.skip from TestTransactions class so tests run against MST-enabled warehouses
  • Covers metadata operations in transactions (cursor.columns, cursor.tables, cursor.schemas, cursor.catalogs, SHOW/DESCRIBE statements)
  • Tests MSTCheckRule-blocked SQL statements and their error handling
  • Tests edge cases: empty transactions, DDL in transactions, connection close with pending txn, concurrent operations, batch operations, PreparedStatement-style parameterized queries
  • Renames test table to pysql_transaction_test_table to avoid collisions with JDBC driver tests
  • Fixes catalogOwned-previewcatalogManaged table property

Test plan

  • Run pytest tests/e2e/test_transactions.py against an MST-enabled warehouse
  • Verify all new tests pass alongside the existing tests

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

Adds 42 new E2E tests and 3 unit tests covering gaps identified in
MST + xDBC metadata audit:

E2E tests (test_transactions.py):
- Metadata operations (cursor.columns/tables/schemas/catalogs) in txn
- MSTCheckRule-blocked SQL (SHOW/DESCRIBE/information_schema) in MST
- Allowed operations (USE CATALOG/SCHEMA) in MST
- DML variants: executemany, parameterized, DELETE, mixed DML in txn
- Concurrent transactions: write conflict, write skew, repeatable reads
- Multiple cursors in single transaction
- Connection close with pending transaction (implicit rollback)
- DDL behavior in transactions (CREATE/DROP/ALTER TABLE)
- Edge cases: empty txn, read-only, atomicity, rollback recovery, MERGE

Unit tests (test_client.py):
- executemany error propagation in transaction context
- Cursor close does not affect transaction state
- Autocommit toggle consistency

Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
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.

1 participant