Skip to content

Commit

Permalink
update test for both paths
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Feb 20, 2024
1 parent fa024ca commit 9332dee
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions e2e_test/udf/always_retry_python.slt
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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
Expand All @@ -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;
DROP FUNCTION sleep_always_retry;

statement ok
DROP FUNCTION sleep_no_retry;

0 comments on commit 9332dee

Please sign in to comment.