From 9332deee78379c2263f84b29a5507fbc4ec1e99b Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Wed, 21 Feb 2024 00:26:23 +0800 Subject: [PATCH] update test for both paths --- e2e_test/udf/always_retry_python.slt | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/e2e_test/udf/always_retry_python.slt b/e2e_test/udf/always_retry_python.slt index ef3ed7bfc4520..4664eb787fd7b 100644 --- a/e2e_test/udf/always_retry_python.slt +++ b/e2e_test/udf/always_retry_python.slt @@ -5,9 +5,12 @@ python3 e2e_test/udf/test.py & sleep 10s statement ok -CREATE FUNCTION sleep(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815'; +CREATE FUNCTION sleep_always_retry(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815' WITH ( always_retry_network_errors = true ); -# Create a table with 60 records +statement ok +CREATE FUNCTION sleep_no_retry(INT) RETURNS INT AS 'sleep' USING LINK 'http://localhost:8815'; + +# Create a table with 30 records statement ok CREATE TABLE t (v1 int); @@ -23,9 +26,12 @@ SET STREAMING_RATE_LIMIT=1; statement ok SET BACKGROUND_DDL=true; +statement ok +CREATE MATERIALIZED VIEW mv_no_retry AS SELECT sleep_no_retry(v1) as s1 from t; + # Create a Materialized View statement ok -CREATE MATERIALIZED VIEW mv AS SELECT sleep(v1) as s1 from t; +CREATE MATERIALIZED VIEW mv_always_retry AS SELECT sleep_always_retry(v1) as s1 from t; # Immediately kill the server, sleep for 1minute. system ok @@ -40,13 +46,27 @@ statement ok wait; query I -SELECT count(*) FROM mv where s1 is NULL; +SELECT count(*) FROM mv_always_retry where s1 is NULL; ---- 0 +query B +SELECT count(*) > 0 FROM mv_no_retry where s1 is NULL; +---- +t + +statement ok +SET STREAMING_RATE_LIMIT=0; + +statement ok +SET BACKGROUND_DDL=false; + # close the server system ok pkill -i python statement ok -DROP FUNCTION sleep; \ No newline at end of file +DROP FUNCTION sleep_always_retry; + +statement ok +DROP FUNCTION sleep_no_retry; \ No newline at end of file