Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
forsaken628 committed Jan 17, 2025
1 parent b8ca9bd commit f26b627
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1000000
2000000
100000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../shell_env.sh

$BENDSQL_CLIENT_CONNECT --query="""
CREATE OR REPLACE FUNCTION js_wait_test ( INT64 ) RETURNS INT64 LANGUAGE javascript HANDLER = 'wait' AS \$\$
export function wait(n) {
let i = 0;
while (i < n * 1000000) { i++ }
return i;
}
\$\$;
"""

$BENDSQL_CLIENT_CONNECT --query='select js_wait_test(100)' &
job_pid=$!
$BENDSQL_CLIENT_CONNECT --query='select js_wait_test(1)'
$BENDSQL_CLIENT_CONNECT --query='select js_wait_test(2)'
wait $job_pid
3 changes: 3 additions & 0 deletions tests/suites/5_ee/08_udf_python/08_0000_parallelism.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1
2
100
19 changes: 19 additions & 0 deletions tests/suites/5_ee/08_udf_python/08_0000_parallelism.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../../../shell_env.sh

$BENDSQL_CLIENT_CONNECT --query="""
CREATE OR REPLACE FUNCTION python_sleep ( INT64 ) RETURNS INT64 LANGUAGE python HANDLER = 'sleep' AS \$\$
import time
def sleep(n):
time.sleep(n/100)
return n
\$\$;
"""

$BENDSQL_CLIENT_CONNECT --query='select python_sleep(100)' &
job_pid=$!
$BENDSQL_CLIENT_CONNECT --query='select python_sleep(1)'
$BENDSQL_CLIENT_CONNECT --query='select python_sleep(2)'
wait $job_pid

0 comments on commit f26b627

Please sign in to comment.