Skip to content

Commit 5aa29fb

Browse files
committed
test: fix expect tests, make them more robust (timeout), correct upload test
1 parent dbb384c commit 5aa29fb

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

tests/download_chunked.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ sleep 0.1
99

1010
echo download1 1>&2
1111
curl -N "http://localhost:${PORT}/foo_50" -o data21 \
12-
-H 'Tranfer-encoding: chunked'
12+
-H 'Tranfer-encoding: chunked' --max-time 10
1313

1414
echo download2 1>&2
1515
curl -N "http://localhost:${PORT}/foo_50" -o data22 \
16-
-H 'Tranfer-encoding: chunked'
16+
-H 'Tranfer-encoding: chunked' --max-time 10
1717

1818
echo download3 1>&2
1919
curl -N "http://localhost:${PORT}/foo_50" -o data23 \
20-
-H 'Tranfer-encoding: chunked'
20+
-H 'Tranfer-encoding: chunked' --max-time 10
2121

2222
kill $PID
2323
wc data21 data22 data23

tests/echo1.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ PORT=8085
66
"$ECHO" -p $PORT &
77
PID=$!
88
sleep 0.1
9-
curl -N "http://localhost:${PORT}/echo/?a=b&c=d" -H user-agent:test
9+
curl -N "http://localhost:${PORT}/echo/?a=b&c=d" -H user-agent:test --max-time 5
1010

1111
sleep 0.1
12-
curl -N "http://localhost:${PORT}/vfs/"
12+
curl -N "http://localhost:${PORT}/vfs/" --max-time 5
1313

1414
sleep 0.1
15-
curl -N "http://localhost:${PORT}/vfs/a.txt"
15+
curl -N "http://localhost:${PORT}/vfs/a.txt" --max-time 5
1616

1717
sleep 0.1
18-
curl -N "http://localhost:${PORT}/vfs/sub/yolo.html"
18+
curl -N "http://localhost:${PORT}/vfs/sub/yolo.html" --max-time 5
1919

2020
kill $PID

tests/sse_count.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ PORT=8086
77
PID=$!
88
sleep 0.1
99

10-
curl -N "http://localhost:${PORT}/count/10" -H user-agent:test
10+
curl -N "http://localhost:${PORT}/count/10" -H user-agent:test --max-time 10
1111
kill $PID

tests/upload-out.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
serve directory . on http://127.0.0.1:8087
2-
server error: Invalid_argument("Bytes.blit")0 0 0 data
2+
upload successful 0 0 52428800 data

tests/upload_chunked.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ PID=$!
1010

1111
sleep 0.1
1212

13-
cat foo_50 | curl -N -X PUT http://localhost:$PORT/data --data-binary @- -H 'Transfer-Encoding: chunked'
13+
cat foo_50 | curl -N -X PUT http://localhost:$PORT/data --data-binary @- \
14+
-H 'Transfer-Encoding: chunked' --max-time 10
1415

1516
kill $PID
1617
wc data

0 commit comments

Comments
 (0)