Skip to content

Commit 9b9fe36

Browse files
committed
Add test for timeouts
1 parent 2ef7148 commit 9b9fe36

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

expected/http.out

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,17 @@ SELECT status FROM http_get('http://httpbin.org/status/555');
175175
555
176176
(1 row)
177177

178+
-- Alter the default timeout and then run a query that is longer than
179+
-- the default (5s), but shorter than the new timeout
180+
SELECT http_set_curlopt('CURLOPT_TIMEOUT_MS', '10000');
181+
http_set_curlopt
182+
------------------
183+
t
184+
(1 row)
185+
186+
SELECT status FROM http_get('http://httpstat.us/200?sleep=7000');
187+
status
188+
--------
189+
200
190+
(1 row)
191+

sql/http.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,7 @@ SELECT http_reset_curlopt();
100100
-- Now it should work
101101
SELECT status FROM http_get('http://httpbin.org/status/555');
102102

103+
-- Alter the default timeout and then run a query that is longer than
104+
-- the default (5s), but shorter than the new timeout
105+
SELECT http_set_curlopt('CURLOPT_TIMEOUT_MS', '10000');
106+
SELECT status FROM http_get('http://httpstat.us/200?sleep=7000');

0 commit comments

Comments
 (0)