From c088ee258e1e7c52389e30c53e980284cb46727c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 22:26:12 +0000 Subject: [PATCH 1/2] Fix clippy warning: replace useless format! with .to_string() https://claude.ai/code/session_017uGnkXcc2zLYNX3sdipDJs --- crates/xtask/src/claude.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/xtask/src/claude.rs b/crates/xtask/src/claude.rs index 30ef688..b2e5395 100644 --- a/crates/xtask/src/claude.rs +++ b/crates/xtask/src/claude.rs @@ -180,8 +180,7 @@ impl Setup { tracing::info!("configuring trust authentication in {hba_path}"); // Replace all auth methods with trust for local and host connections. - let new_contents = format!( - "\ + let new_contents = "\ # durable-xtask: trust auth configured # This file was modified by `cargo xtask claude setup` to allow passwordless # local development connections. @@ -189,7 +188,7 @@ local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trust " - ); + .to_string(); std::fs::write(&hba_path, new_contents) .with_context(|| format!("failed to write {hba_path}"))?; From 65cc479a49ebec34f40a820f760d401832d326c8 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 21:10:36 +0000 Subject: [PATCH 2/2] Fix race condition in dst_notify_timeout_records_scheduler_events test The test was checking for TaskCompleted scheduler events immediately after task.wait() returned. There is a small window between when the worker commits the task's "complete" state to the database (which causes task.wait() to return) and when it calls scheduler.notify(TaskCompleted). On a multi-threaded runtime the test can read the scheduler events before the worker records the event. Fix by polling for the TaskCompleted event with a timeout instead of checking it once. https://claude.ai/code/session_017uGnkXcc2zLYNX3sdipDJs --- crates/durable-test/tests/it/dst_notify.rs | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/crates/durable-test/tests/it/dst_notify.rs b/crates/durable-test/tests/it/dst_notify.rs index 1d58b6f..4bea2a8 100644 --- a/crates/durable-test/tests/it/dst_notify.rs +++ b/crates/durable-test/tests/it/dst_notify.rs @@ -283,13 +283,28 @@ async fn dst_notify_timeout_records_scheduler_events(pool: sqlx::PgPool) -> anyh ); // TaskCompleted should have fired exactly once. - let complete_count = scheduler - .events() - .iter() - .filter(|e| { - matches!(e, durable_runtime::scheduler::ScheduleEvent::TaskCompleted { task_id, .. } if *task_id == task.id()) - }) - .count(); + // + // There is a small window between when the worker commits the task's + // "complete" state to the database (which causes `task.wait()` to return) + // and when it calls `scheduler.notify(TaskCompleted)`. On a multi-threaded + // runtime we may need to yield briefly to let the worker finish. + let complete_count = timeout(Duration::from_secs(5), async { + loop { + let count = scheduler + .events() + .iter() + .filter(|e| { + matches!(e, durable_runtime::scheduler::ScheduleEvent::TaskCompleted { task_id, .. } if *task_id == task.id()) + }) + .count(); + if count > 0 { + break count; + } + tokio::task::yield_now().await; + } + }) + .await + .context("TaskCompleted event not recorded within 5s")?; assert_eq!( complete_count, 1, "expected exactly 1 TaskCompleted event, got {complete_count}"