Skip to content

Commit 2b45b85

Browse files
committed
test: match tests to canonical "does not exist" absent-collection error
Update expected error substrings from the legacy "not found" / "unknown table" wording to the canonical "does not exist" (SQLSTATE 42P01), still accepting the older wordings where cross-tenant isolation semantics require it.
1 parent daab991 commit 2b45b85

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

nodedb/tests/database_boundary.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,12 @@ async fn cross_database_collection_looks_absent() {
234234
server
235235
.expect_error(
236236
"SELECT * FROM cross_secret",
237-
// The error must match the "not found" family; it must NOT
238-
// mention a distinct "database boundary" code.
239-
"not found",
237+
// Must surface as the canonical absent-collection error
238+
// (`does not exist`, SQLSTATE 42P01) — indistinguishable from a
239+
// truly-absent collection. It must NOT mention a distinct
240+
// "database boundary" code that would leak the collection's
241+
// existence in another database.
242+
"does not exist",
240243
)
241244
.await;
242245
}

nodedb/tests/pgwire_returning_dml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async fn unicode_identifier_before_returning_preserves_connection() {
252252
let server = TestServer::start().await;
253253

254254
server
255-
.expect_error("DELETE FROM missingffff RETURNING *", "not found")
255+
.expect_error("DELETE FROM missingffff RETURNING *", "does not exist")
256256
.await;
257257
let rows = server
258258
.query_text("SELECT 1")

nodedb/tests/pgwire_tenant_scoping.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,15 @@ async fn tenant_user_cannot_see_other_tenants_collection_as_empty() {
196196
let result = query_as(&server, "svc_xtn", "SELECT secret FROM t1_only").await;
197197
match result {
198198
Err(msg) => {
199-
// Accept both legacy "unknown table" and the canonical
200-
// "table not found" wording — semantics are identical
201-
// (cross-tenant isolation enforced via lookup failure).
199+
// Cross-tenant isolation is enforced via lookup failure: the
200+
// collection must appear absent. Accept the legacy "unknown table"
201+
// / "table not found" wordings and the now-canonical
202+
// "does not exist" (SQLSTATE 42P01) — semantics are identical.
202203
let lower = msg.to_lowercase();
203204
assert!(
204-
lower.contains("unknown table") || lower.contains("table not found"),
205+
lower.contains("unknown table")
206+
|| lower.contains("table not found")
207+
|| lower.contains("does not exist"),
205208
"expected isolation error, got: {msg}"
206209
);
207210
}

0 commit comments

Comments
 (0)