From 2a11205296238cdee2fe7fa1463a2b79ca37053c Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Mon, 22 Apr 2024 17:30:23 +0800 Subject: [PATCH] test: refine root cause identification test of recovery (#16431) Signed-off-by: Bugen Zhao --- e2e_test/error_ui/simple/recovery.slt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/e2e_test/error_ui/simple/recovery.slt b/e2e_test/error_ui/simple/recovery.slt index aa159c4486492..b47afc94c47ad 100644 --- a/e2e_test/error_ui/simple/recovery.slt +++ b/e2e_test/error_ui/simple/recovery.slt @@ -12,19 +12,25 @@ statement ok insert into t values (1); # Wait for recovery to complete. -sleep 10s +sleep 15s # Check that there's a log entry for barrier collection failure on the mata node. -# The message should contain the root cause of the failure: "Division by zero". +# Extract the message to check that it contains the root cause of the failure. query T -select info::varchar like -'%Actor % exited unexpectedly: Executor error: Chunk operation error: Division by zero%' -from rw_catalog.rw_event_logs -where event_type = 'COLLECT_BARRIER_FAIL' -order by timestamp desc -limit 1; +with error as ( + select info->'collectBarrierFail'->'error' #>> '{}' as error + from rw_catalog.rw_event_logs + where event_type = 'COLLECT_BARRIER_FAIL' + order by timestamp desc + limit 1 +) +select +case when error like '%Actor % exited unexpectedly: Executor error: Chunk operation error: Division by zero%' then 'ok' + else error +end as result +from error; ---- -t +ok statement ok drop table t cascade;