Skip to content

Commit 3b53236

Browse files
committed
test(query): assert the decode failure, not just any failure
1 parent 4748e7e commit 3b53236

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎src/commands/query.rs‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,9 +2378,19 @@ mod tests {
23782378
let err = stream_csv(&mut batches, &columns, &mut out)
23792379
.expect_err("a body that ends mid-message must not read as a clean end of stream");
23802380
let msg = err.message();
2381+
// Both error paths carry a message, so an emptiness check would pass on
2382+
// either. This has to be the decode failure travelling as
2383+
// `BatchMessage::Failed` — if the reader panicked instead, the queue
2384+
// would close with no marker and `next_queued` would produce its own
2385+
// reader-stopped error, which is a different bug wearing the same exit
2386+
// code.
23812387
assert!(
2382-
!msg.is_empty(),
2383-
"the failure has to name something a caller can act on"
2388+
!msg.contains("the result reader stopped"),
2389+
"the reader died instead of reporting the decode failure: {msg}"
2390+
);
2391+
assert!(
2392+
msg.to_lowercase().contains("arrow") || msg.to_lowercase().contains("ipc"),
2393+
"the failure should name the decode that failed, got {msg}"
23842394
);
23852395
}
23862396

0 commit comments

Comments
 (0)