Repository navigation
Commit a8e4345
authored
fix(conformance): make namespace cleanup failures visible (#65)
Closes #52. Part of #54.
## What changed
- `XerialTestServer.releaseNamespace` now checks the admin `DELETE`
status. Transient responses (I/O, 408, 429, 5xx) are retried up to three
times; any non-2xx response other than 404 is surfaced as an
`IllegalStateException`.
- A namespace whose delete failed is recorded as failed, and
`ensureNamespace` refuses to reuse it. A 409 from namespace create is no
longer treated as success, so a stale namespace cannot be silently
adopted.
- Cleanup failures during `connect` are attached as suppressed to the
primary connection error.
- `NamespaceClosingHandler` now releases on `close`, `abort`, and
`unwrap(Connection.class)`. `unwrap` returns the proxy so closing the
unwrapped handle still releases, and release still runs if the
underlying close/abort throws.
- Vendored `JSON1Test` closes its per-test connection via `@AfterEach`;
vendored `CachedRowSetTest` closes its connection with
try-with-resources.
- Updated `upstream-xerial_sqlite-jdbc.manifest` with the two divergence
notes and `CHECKSUMS.sha256` with the current hashes, using the
mechanism from #53. `tools/export-upstream --verify` passes.
## Contract decision
Parity with xerial 3.53.4.0 at the pinned tag. The only deviations are
the two vendored test edits, which are test-only and required by the
Hrana namespace lifecycle: a sqld namespace lives until its last
connection closes, so the upstream tests that leak connections would
leak namespaces for the whole run.
## Evidence
Failing before the fix (original cleanup behavior, with only the test
seam in place):
```
./mvnw -pl libsql-conformance -am -Dit.test='XerialTestServerCleanupTest,NamespaceClosingHandlerTest' -DfailIfNoTests=false verify
...
[ERROR] Tests run: 9, Failures: 5, Errors: 1, Skipped: 0
[INFO] BUILD FAILURE
```
Failures covered failed-delete visibility, retry, 409 reuse, abort
release, and unwrap release.
Passing after the fix:
```
./mvnw -pl libsql-conformance -am -Dit.test='XerialTestServerCleanupTest,NamespaceClosingHandlerTest' -DfailIfNoTests=false verify
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
```
Full verification:
```
./mvnw -pl libsql-jdbc -am test
[INFO] BUILD SUCCESS
./mvnw -pl libsql-conformance -am verify
[INFO] Tests run: 115, Failures: 0, Errors: 0, Skipped: 1
[INFO] BUILD SUCCESS
./mvnw spotless:apply
[INFO] BUILD SUCCESS
./tools/export-upstream --verify
Verified upstream-xerial_sqlite-jdbc against upstream-xerial_sqlite-jdbc.manifest
```
## Deviations
The two vendored test edits above are the only deviations from the
pinned xerial tag, and both are recorded in
`upstream-xerial_sqlite-jdbc.manifest` with updated `CHECKSUMS.sha256`
current hashes. Runtime behavior is otherwise unchanged.1 parent de56052 commit a8e4345
8 files changed
Lines changed: 485 additions & 44 deletions
File tree
- libsql-conformance/src/test/java/com/github/magnusp/libsql/conformance
- upstream-xerial_sqlite-jdbc
- src/test/java/org/sqlite
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
98 | 112 | | |
99 | 113 | | |
100 | 114 | | |
| |||
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| 133 | + | |
119 | 134 | | |
120 | 135 | | |
121 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
122 | 142 | | |
123 | 143 | | |
| 144 | + | |
124 | 145 | | |
125 | 146 | | |
126 | 147 | | |
| |||
129 | 150 | | |
130 | 151 | | |
131 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
132 | 163 | | |
133 | 164 | | |
134 | 165 | | |
| |||
143 | 174 | | |
144 | 175 | | |
145 | 176 | | |
146 | | - | |
147 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
148 | 213 | | |
149 | 214 | | |
150 | 215 | | |
| |||
0 commit comments