From 785f9d7fd7531e85fc793e5ab3a87c32f9dfe25b Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Mon, 27 Oct 2025 16:07:51 +0800 Subject: [PATCH] fix: add delays in reconcile tests for async cache invalidation (#7147) Signed-off-by: WenyXu --- src/frontend/src/heartbeat.rs | 3 +++ tests-integration/src/tests/reconcile_table.rs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/frontend/src/heartbeat.rs b/src/frontend/src/heartbeat.rs index 95645ad1ca..9c3954b0c6 100644 --- a/src/frontend/src/heartbeat.rs +++ b/src/frontend/src/heartbeat.rs @@ -104,6 +104,9 @@ impl HeartbeatTask { match resp_stream.message().await { Ok(Some(resp)) => { debug!("Receiving heartbeat response: {:?}", resp); + if let Some(message) = &resp.mailbox_message { + info!("Received mailbox message: {message:?}"); + } let ctx = HeartbeatResponseHandlerContext::new(mailbox.clone(), resp); if let Err(e) = capture_self.handle_response(ctx).await { error!(e; "Error while handling heartbeat response"); diff --git a/tests-integration/src/tests/reconcile_table.rs b/tests-integration/src/tests/reconcile_table.rs index bd83a7d930..3e8414436d 100644 --- a/tests-integration/src/tests/reconcile_table.rs +++ b/tests-integration/src/tests/reconcile_table.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::time::Duration; + use client::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, OutputData}; use common_meta::reconciliation::ResolveStrategy; use common_meta::reconciliation::manager::ReconciliationManagerRef; @@ -165,6 +167,8 @@ async fn test_reconcile_dropped_column() { "grpc_latencies", ) .await; + // Try best effort to wait for the cache to be invalidated. + tokio::time::sleep(Duration::from_secs(1)).await; // Now we should able to query table again. let output = execute_sql(&frontend, "SELECT * FROM grpc_latencies ORDER BY host").await; @@ -268,6 +272,8 @@ async fn test_reconcile_added_column() { "grpc_latencies", ) .await; + // Try best effort to wait for the cache to be invalidated. + tokio::time::sleep(Duration::from_secs(1)).await; // Now the column cloud_provider is available. let output = execute_sql(&frontend, "SELECT * FROM grpc_latencies ORDER BY host").await; @@ -342,6 +348,8 @@ async fn test_reconcile_modify_column_type() { "grpc_latencies", ) .await; + // Try best effort to wait for the cache to be invalidated. + tokio::time::sleep(Duration::from_secs(1)).await; // Now we can query the table again. let output = execute_sql(&frontend, "SELECT * FROM grpc_latencies ORDER BY host").await;