Add connection/cancel-timeout/volume negative suites (PR 5b/8)#1529
Merged
sreekanth-db merged 1 commit intoJul 3, 2026
Merged
Conversation
Completes the isolation-heavy negative suites on top of the ConnectionFactory mechanism from PR 5a. ConnectionFactory extension — NEGATIVE_CONNECTION needs to build deliberately broken connections, so the factory now also exposes urlFor(side), token(), and open(url, token) (an uncached open with an arbitrary URL/token). Backed by ConnectionManager.openUncached(url, token) + getToken(). Suites: - NEGATIVE_CONNECTION: opening is the test — starts from a side's healthy URL/ token and corrupts one piece (bad token, unknown host, malformed httpPath, bad warehouse id, bad ConnCatalog/ConnSchema), then compares the connect failure. Closes any connection that unexpectedly opens. - NEGATIVE_CANCEL_TIMEOUT: cancel() mid slow query / after completion / on an already-cancelled statement, and setQueryTimeout(1) on a slow query. Own fresh connections; the slow query is a bounded range cross-join (~5s, no server-side sleep) to keep load and flakiness low. - NEGATIVE_VOLUME: GET/PUT/REMOVE failures + op-after-close. Runs under the VOLUME_OPERATIONS config (needs VolumeOperationAllowedLocalPaths), so it is excluded from DEFAULT_PARAMS like the positive VOLUME_OPERATIONS suite. Validated live against the peco serverless warehouse (Thrift-vs-SEA, shadow): positive suites run in the same JVM after the isolation-heavy negatives and still PASS. NEGATIVE_CONNECTION surfaced real error-shape divergences (bad token/host/warehouse); NEGATIVE_CANCEL_TIMEOUT surfaced two one-sided findings (cancel-after-complete and double-cancel throw STATEMENT_CLOSED on one side). NEGATIVE_VOLUME is all-PASS — confirmed meaningful (not vacuous) via a throwaway probe: every case throws DatabricksVolumeOperationException / statement-closed identically on both endpoints. ErrorComparatorTest: 20/20. Isaac Review: 0 findings. NO_CHANGELOG=true (test-only comparator tooling). Co-authored-by: Isaac Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
sreekanth-db
added a commit
that referenced
this pull request
Jul 3, 2026
…8) (#1530) ## What The final batch of negative suites — row-limit rejection, ResultSet misuse, and the Databricks async extension API. Builds on #1524–#1529. | Suite | Cases | |---|---| | `NEGATIVE_STATEMENT_SELECT_TRUNCATED` | invalid `setMaxRows`/`setLargeMaxRows` values (negative, `MIN_VALUE`) — set-then-execute captured together since the failure may originate at either point | | `NEGATIVE_RESULTSET` | `next()`/`getObject()` after the ResultSet or Statement is closed; out-of-range column index | | `NEGATIVE_ASYNC` | `getExecutionResult()` before any async execution; `executeAsync()` on invalid SQL; `getExecutionResult()` after the statement is closed | ### Notes on scope - **`NEGATIVE_RESULTSET`**: the originally-planned CloudFetch link-expiry / chunk-download failure is **intentionally omitted** — it can't be provoked deterministically from a client test (links are valid for the query's lifetime; expiry is time/infra dependent), and would require server-side fault injection out of scope for this harness. Documented in the provider javadoc. - **`NEGATIVE_ASYNC`**: uses `stmt.unwrap(IDatabricksStatement.class)`. The invalid-SQL case **polls `getExecutionResult`** so the async failure is actually captured — `executeAsync` only submits; the syntax error surfaces on result retrieval. ## Live validation Ran against the peco serverless warehouse (Thrift-vs-SEA, `ERROR_COMPARISON_MODE=shadow`). Positive `STATEMENT_SELECT` runs in the same JVM and still **PASSes**. Each case was **probe-verified to hit a real error path** (not vacuous PASS): - `setMaxRows(-1)` → `DatabricksValidationException: Invalid input for maxRows` - `getExecutionResult()` before exec → `DatabricksSQLException: No execution available` - next-after-close → `Operation not allowed - ResultSet is closed` - `getObject(999)` → real 3-field error mismatch (DIFF) The all-PASS cases are genuine agreement (both endpoints throw identically), confirmed via a throwaway probe. Also **caught and fixed a vacuous first cut** of the async invalid-SQL case that captured only the successful submit rather than the eventual failure. ## Testing `ErrorComparatorTest` — 20/20; live shadow runs + probe; clean compile; Isaac Review (`/review --uncommitted`) — 0 findings. NO_CHANGELOG=true (test-only comparator tooling, no driver behavior change). This pull request and its description were written by Isaac. Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Completes the isolation-heavy negative suites, on top of the
ConnectionFactorymechanism from #1528. Builds on #1524–#1528.ConnectionFactory extension
NEGATIVE_CONNECTIONneeds to build deliberately-broken connections, so the factory now also exposesurlFor(side),token(), andopen(url, token)(an uncached open with an arbitrary URL/token). Backed byConnectionManager.openUncached(url, token)+getToken().Suites
NEGATIVE_CONNECTION— opening is the test: starts from a side's healthy URL/token and corrupts one piece (bad token, unknown host, malformed httpPath, bad warehouse id, badConnCatalog/ConnSchema), then compares the connect failure. Closes any connection that unexpectedly opens.NEGATIVE_CANCEL_TIMEOUT—cancel()mid slow query / after completion / on an already-cancelled statement, andsetQueryTimeout(1)on a slow query. Own fresh connections; the slow query is a bounded range cross-join (~5s, no server-side sleep) to keep load and flakiness low.NEGATIVE_VOLUME— GET/PUT/REMOVE failures + op-after-close. Runs under theVOLUME_OPERATIONSconfig (needsVolumeOperationAllowedLocalPaths), so it is excluded fromDEFAULT_PARAMSlike the positive VOLUME_OPERATIONS suite.Live validation
Ran against the peco serverless warehouse (Thrift-vs-SEA,
ERROR_COMPARISON_MODE=shadow). Positive suites run in the same JVM after the isolation-heavy negatives and still PASS — no shared-connection poisoning.NEGATIVE_CONNECTIONsurfaced real error-shape divergences (bad token/host/warehouse).NEGATIVE_CANCEL_TIMEOUTsurfaced two one-sided findings: cancel-after-complete and double-cancel throwSTATEMENT_CLOSEDon one side and return normally on the other.NEGATIVE_VOLUMEis all-PASS — confirmed meaningful (not vacuous) via a throwaway probe: every case genuinely throwsDatabricksVolumeOperationException/ statement-closed identically on both endpoints, so PASS is real agreement.Testing
ErrorComparatorTest— 20/20; live shadow runs (two, + volume probe); clean compile; Isaac Review (/review --uncommitted) — 0 findings.NO_CHANGELOG=true (test-only comparator tooling, no driver behavior change).
This pull request and its description were written by Isaac.