Skip to content

Commit 169975d

Browse files
committed
ci: python: set test execution timeout
* 5 min for individual tests * 1 hour for compiling aggregate tests Also changes the shebang on the bash scripts to `/usr/bin/env bash` instead of `/bin/bash` as it doesn't exist in non Filesystem Hierarchy Standard compliant systems (like NixOS). Signed-off-by: Abhinav Gyawali <22275402+abhizer@users.noreply.github.com>
1 parent 88109a8 commit 169975d

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

Earthfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ test-python:
295295
(./pipeline-manager --bind-address=0.0.0.0 --compiler-working-directory=/working-dir/compiler --runner-working-directory=/working-dir/local-runner --sql-compiler-home=/dbsp/sql-to-dbsp-compiler --dbsp-override-path=/dbsp --db-connection-string=postgresql://postgres:postgres@localhost:5432 --compilation-profile=unoptimized &) && \
296296
sleep 5 && \
297297
PYTHONPATH=`pwd` python3 ./tests/aggregate_tests/main.py && \
298-
if [ $ALL = "1" ]; then \
299-
cd tests && python -m pytest . ; \
298+
if [ $all = "1" ]; then \
299+
cd tests && python -m pytest . --timeout=300; \
300300
else \
301301
echo "Skipping pytest as --all argument is not set to 1"; \
302302
fi

python/tests/aggregate_tests/aggtst_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def run_tests(self):
163163
data = table.get_data()
164164
pipeline.input_json(table.name, data, update_format="insert_delete")
165165

166-
pipeline.wait_for_completion(shutdown=False)
166+
pipeline.wait_for_completion(shutdown=False, timeout_s=3600)
167167
for view in self.views:
168168
view.validate(pipeline)
169169

python/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
kafka-python-ng==2.2.2
2-
pytest
2+
pytest-timeout

python/tests/test_udf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,16 @@ def test_local(self):
193193
pub fn nt2nt(i: Time) -> Result<Time, Box<dyn std::error::Error>> {
194194
Ok(i)
195195
}
196-
pub fn arr2arr(i: Option<Vec<Option<i32>>>) -> Result<Option<Vec<Option<i32>>>, Box<dyn std::error::Error>> {
196+
pub fn arr2arr(i: Option<Array<Option<i32>>>) -> Result<Option<Array<Option<i32>>>, Box<dyn std::error::Error>> {
197197
Ok(i)
198198
}
199-
pub fn narr2narr(i: Vec<Option<i32>>) -> Result<Vec<Option<i32>>, Box<dyn std::error::Error>> {
199+
pub fn narr2narr(i: Array<Option<i32>>) -> Result<Array<Option<i32>>, Box<dyn std::error::Error>> {
200200
Ok(i)
201201
}
202-
pub fn map2map(i: Option<BTreeMap<String, Option<String>>>) -> Result<Option<BTreeMap<String, Option<String>>>, Box<dyn std::error::Error>> {
202+
pub fn map2map(i: Option<Map<SqlString, Option<SqlString>>>) -> Result<Option<Map<SqlString, Option<SqlString>>>, Box<dyn std::error::Error>> {
203203
Ok(i)
204204
}
205-
pub fn nmap2nmap(i: BTreeMap<String, Option<String>>) -> Result<BTreeMap<String, Option<String>>, Box<dyn std::error::Error>> {
205+
pub fn nmap2nmap(i: Map<SqlString, Option<SqlString>>) -> Result<Map<SqlString, Option<SqlString>>, Box<dyn std::error::Error>> {
206206
Ok(i)
207207
}
208208
pub fn var2var(i: Option<Variant>) -> Result<Option<Variant>, Box<dyn std::error::Error>> {
@@ -217,10 +217,10 @@ def test_local(self):
217217
pub fn ndec2ndec(i: Decimal) -> Result<Decimal, Box<dyn std::error::Error>> {
218218
Ok(i)
219219
}
220-
pub fn str2str(i: Option<String>) -> Result<Option<String>, Box<dyn std::error::Error>> {
220+
pub fn str2str(i: Option<SqlString>) -> Result<Option<SqlString>, Box<dyn std::error::Error>> {
221221
Ok(i)
222222
}
223-
pub fn nstr2nstr(i: String) -> Result<String, Box<dyn std::error::Error>> {
223+
pub fn nstr2nstr(i: SqlString) -> Result<SqlString, Box<dyn std::error::Error>> {
224224
Ok(i)
225225
}
226226
// pub fn struct2struct(i: Option<struct_1>) -> Result<Option<struct_2>, Box<dyn std::error::Error>> {

python/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/start_manager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

sql-to-dbsp-compiler/SQL-compiler/sql-to-dbsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

sql-to-dbsp-compiler/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

0 commit comments

Comments
 (0)