Skip to content

Commit 20e0bc0

Browse files
committed
fix: tolerate missing schema_fingerprints table in BDD cleanup
The schema_fingerprints table may not exist if the schema-registry hasn't finished migrating when the first BDD scenario cleanup runs. Handle the "unconfigured table" error gracefully instead of failing hard, which was causing the BDD Cassandra tests to hang.
1 parent a599798 commit 20e0bc0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/bdd/bdd_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,20 @@ func cleanCassandra() error {
330330
"id_alloc", "modes", "global_config", "subject_configs",
331331
"references_by_target", "schema_references",
332332
"subject_latest", "subject_versions",
333-
"schemas_by_id", "schema_fingerprints",
333+
"schemas_by_id",
334334
}
335335
for _, t := range tables {
336336
if err := session.Query("TRUNCATE " + t).Exec(); err != nil {
337337
return fmt.Errorf("truncate %s: %w", t, err)
338338
}
339339
}
340+
// schema_fingerprints may not exist on older schema-registry images;
341+
// ignore "unconfigured table" errors so cleanup stays compatible.
342+
if err := session.Query("TRUNCATE schema_fingerprints").Exec(); err != nil {
343+
if !strings.Contains(err.Error(), "unconfigured table") {
344+
return fmt.Errorf("truncate schema_fingerprints: %w", err)
345+
}
346+
}
340347

341348
// Re-seed id_alloc so GetMaxSchemaID works (block-based allocator
342349
// caches IDs in-process, but GetMaxSchemaID reads from the table).

0 commit comments

Comments
 (0)