Repository navigation
test(conformance): fail the prepared-statement race test on runtime errors (#118) - #129
Merged
Merged
Conversation
…rrors (#118) Tolerate only an SQLException cause in the vendored race helper and await both futures before rethrowing, so a runtime failure cannot pass silently. Record the narrower divergence and update the checksum.
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.
Fixes #118.
Contract: Hrana 3 is the source of truth for transport, values, and metadata; java.sql is the source of truth for the JDBC surface; xerial/sqlite-jdbc is a behavioral reference and conformance foundation, never a copy target.
Protocol basis is protocol-neutral. Hrana over HTTP requires serialized requests per stream and consumes a baton once, so this test guards the client's serialization obligation.
Change
PreparedStatementThreadTest.testRacenow captures the query and close outcomes separately, awaits both futures, tolerates only anSQLExceptioncause, and rethrows every other failure. The test methods declareExecutionExceptionso the rethrow is real.Red and green evidence
Injected
throw new NullPointerException("injected runtime race failure")into the query future in a scratch copy, and updated only the scratch checksum. The injection was removed before the commit.AssertionError) with the injection:Tests run: 2, Failures: 0, Errors: 0and BUILD SUCCESS./tmp/xerial-parity-i118/red-old-divergence.logTests run: 2, Failures: 0, Errors: 2, both failed withExecutionException: java.lang.NullPointerException: injected runtime race failure, BUILD FAILURE./tmp/xerial-parity-i118/red-new-divergence.logTests run: 2, Failures: 0, Errors: 0, BUILD SUCCESS./tmp/xerial-parity-i118/green-targeted.logDivergence recorded
# divergence: src/test/java/org/sqlite/PreparedStatementThreadTest.java -- upstream swallows every ExecutionException, which hides assertion failures and runtime exceptions from the close/execute race; Hrana serializes requests per stream, so the conformance copy awaits both futures and tolerates only an SQLException cause, and any runtime failure fails the test as the Java equivalent of the native crash it guards (#51, #118).The
# upstreamhash is unchanged. The current hash inCHECKSUMS.sha256moves to8e63f29bec87782e5705ebff748389cb9f5fe3a68d755c730a2beaccde9712a4.Verification
All lanes at head
81e315f07394ecd683d6740f5846e2669e247636../mvnw -pl libsql-conformance -am verify -Dit.test=PreparedStatementThreadTest: pass, 2 of 2 tests../mvnw -pl libsql-conformance -am verify: pass, 115 tests, 1 pre-existing skip../mvnw -pl libsql-conformance -am -Pxerial-control verify: pass, 100 tests, 1 pre-existing skip.tools/export-upstream --verify: pass../mvnw spotless:check: pass../mvnw test: pass, BUILD SUCCESS../mvnw -pl libsql-conformance -am package -DskipTests: pass.Files changed are the vendored test,
upstream-xerial_sqlite-jdbc.manifest, andupstream-xerial_sqlite-jdbc/CHECKSUMS.sha256.Base
8e9aaf6746eb48b34639455ecb8657488f08e5f8, head81e315f07394ecd683d6740f5846e2669e247636.