Commit 3aec164
Fix metadata thrift recordings (#1236)
## Summary
- Re-recorded WireMock stubs for 7 metadata tests that had invalid 403
"RBAC: access denied" recordings (GetTypeInfo, GetProcedures,
GetProcedureColumns, GetFunctions, GetExportedKeys, GetVersionColumns,
GetAttributes)
- Added new Thrift recordings for GetIndexInfo test
- Fixed flaky `testSetAndGetSchema` and `testSetAndGetCatalog` in
ConnectionIntegrationTests by adding `safeClose()` helper that skips
`connection.close()` in THRIFT + REPLAY mode
## Root Cause
**8 Metadata test failures:** The original Thrift recordings were
captured with an expired/unauthorized token, resulting in 403 responses
being recorded as WireMock stubs. When replayed in CI, the 403 caused
`getValidJDBCConnection()` to throw, and the `setUp()` method's catch
block silently swallowed the error, leaving `connection=null` which
NPE'd in each test.
**Flaky ConnectionIntegrationTests:** `testSetAndGetSchema` and
`testSetAndGetCatalog` execute statements (SET CATALOG, USE SCHEMA)
which generate `CloseOperation` Thrift calls during `conn.close()`.
WireMock uses exact binary body matching (`binaryEqualTo`) for these
stubs, but stub registration order from disk is non-deterministic. When
stubs load in the wrong order, WireMock returns 404 for CloseOperation
calls. This is the same known issue that all other fake service test
classes already work around by skipping `connection.close()` in THRIFT +
REPLAY mode.
## Test plan
- [x] All 7 re-recorded metadata tests verified to pass in THRIFT_SERVER
+ REPLAY mode
- [x] Full MetadataIntegrationTests suite (46 tests) passes with 0
failures
- [x] ConnectionIntegrationTests (17 tests) passes with 0 failures, 3
consecutive runs
- [x] All 5 test classes (150 tests total) pass 3/3 consecutive runs in
both THRIFT and SQL_EXEC replay modes
- [x] No regressions in other existing fake service test classes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
NO_CHANGELOG=true
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 48534f8 commit 3aec164
1 file changed
Lines changed: 22 additions & 2 deletions
File tree
- src/test/java/com/databricks/jdbc/integration/fakeservice/tests
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | | - | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
157 | | - | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
247 | 267 | | |
248 | 268 | | |
249 | 269 | | |
| |||
0 commit comments