Skip to content

Commit 64606ac

Browse files
authored
Print internal error when a procedure call fails in sdk test client (#3725)
# Description of Changes And also add a `log::warn` call next to a `tracing::warn` call, since our tests don't seem to report tracing output. In response to suspicious test flake https://github.com/clockworklabs/SpacetimeDB/actions/runs/19577977435/job/56068366154?pr=3409 . # API and ABI breaking changes N/a # Expected complexity level and risk 1 # Testing N/a
1 parent 53f692d commit 64606ac

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

crates/core/src/client/client_connection.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,11 @@ impl ClientConnectionSender {
392392
confirmed_reads = self.config.confirmed_reads,
393393
"client channel capacity exceeded"
394394
);
395+
log::warn!(
396+
"Client {:?} exceeded channel capacity of {}, kicking",
397+
self.id,
398+
self.sendtx.capacity(),
399+
);
395400
self.abort_handle.abort();
396401
self.cancelled.store(true, Ordering::Relaxed);
397402
return Err(ClientSendError::Cancelled);

sdks/rust/tests/procedure-client/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn exec_insert_with_tx_commit() {
210210
sub_applied_nothing_result(assert_all_tables_empty(ctx));
211211

212212
ctx.procedures.insert_with_tx_commit_then(move |ctx, res| {
213-
assert!(res.is_ok());
213+
assert!(res.is_ok(), "Expected Ok result but got {res:?}");
214214
let row = ctx.db().my_table().iter().next().unwrap();
215215
assert_eq!(row.field, expected());
216216
inspect_result(Ok(()));
@@ -237,7 +237,7 @@ fn exec_insert_with_tx_rollback() {
237237
sub_applied_nothing_result(assert_all_tables_empty(ctx));
238238

239239
ctx.procedures.insert_with_tx_rollback_then(move |ctx, res| {
240-
assert!(res.is_ok());
240+
assert!(res.is_ok(), "Expected Ok result but got {res:?}");
241241
assert_eq!(ctx.db().my_table().iter().next(), None);
242242
inspect_result(Ok(()));
243243
});
@@ -264,7 +264,7 @@ fn exec_procedure_http_ok() {
264264
// It's a try block!
265265
#[allow(clippy::redundant_closure_call)]
266266
(|| {
267-
anyhow::ensure!(res.is_ok());
267+
anyhow::ensure!(res.is_ok(), "Expected Ok result but got {res:?}");
268268
let module_def: RawModuleDefV9 = spacetimedb_lib::de::serde::deserialize_from(
269269
&mut serde_json::Deserializer::from_str(&res.unwrap()),
270270
)?;
@@ -300,7 +300,7 @@ fn exec_procedure_http_err() {
300300
// It's a try block!
301301
#[allow(clippy::redundant_closure_call)]
302302
(|| {
303-
anyhow::ensure!(res.is_ok());
303+
anyhow::ensure!(res.is_ok(), "Expected Ok result but got {res:?}");
304304
let error = res.unwrap();
305305
anyhow::ensure!(error.contains("error"));
306306
anyhow::ensure!(error.contains("http://foo.invalid/"));

0 commit comments

Comments
 (0)