@@ -8,7 +8,7 @@ def test_http_get_timeout_reached(sess):
8
8
9
9
(request_id ,) = sess .execute (text (
10
10
"""
11
- select net.http_get(url := 'http://localhost:9999/p/ 200:b"wait%20for%20six%20seconds"pr, 6');
11
+ select net.http_get(url := 'http://localhost:8080/pathological?status= 200&delay= 6');
12
12
"""
13
13
)).fetchone ()
14
14
@@ -33,35 +33,35 @@ def test_http_get_succeed_with_gt_timeout(sess):
33
33
34
34
(request_id ,) = sess .execute (text (
35
35
"""
36
- select net.http_get(url := 'http://localhost:9999/p/ 200:b"wait%20for%20three%20seconds"pr, 3', timeout_milliseconds := 3500);
36
+ select net.http_get(url := 'http://localhost:8080?status= 200&delay= 3', timeout_milliseconds := 3500);
37
37
"""
38
38
)).fetchone ()
39
39
40
40
sess .commit ()
41
41
42
42
time .sleep (4 )
43
43
44
- (response ,) = sess .execute (
44
+ (status_code ,) = sess .execute (
45
45
text (
46
46
"""
47
- select content from net._http_response where id = :request_id;
47
+ select status_code from net._http_response where id = :request_id;
48
48
"""
49
49
),
50
50
{"request_id" : request_id },
51
51
).fetchone ()
52
52
53
- assert 'wait for three seconds' in str ( response )
53
+ assert status_code == 200
54
54
55
55
def test_many_slow_mixed_with_fast (sess ):
56
56
"""many fast responses finish despite being mixed with slow responses, the fast responses will wait the timeout duration"""
57
57
58
58
sess .execute (text (
59
59
"""
60
60
select
61
- net.http_get(url := 'http://localhost:9999/p/ 200')
62
- , net.http_get(url := 'http://localhost:9999/p/ 200:pr,f ')
63
- , net.http_get(url := 'http://localhost:9999/p/ 200')
64
- , net.http_get(url := 'http://localhost:9999/p/ 200:pr,f ')
61
+ net.http_get(url := 'http://localhost:8080/pathological?status= 200')
62
+ , net.http_get(url := 'http://localhost:8080/pathological?status= 200&delay=10 ')
63
+ , net.http_get(url := 'http://localhost:8080/pathological?status= 200')
64
+ , net.http_get(url := 'http://localhost:8080/pathological?status= 200&delay=10 ')
65
65
from generate_series(1,25) _;
66
66
"""
67
67
))
@@ -79,3 +79,10 @@ def test_many_slow_mixed_with_fast(sess):
79
79
80
80
assert status_code == 200
81
81
assert count == 50
82
+
83
+ (timed_out_count ,) = sess .execute (text (
84
+ """
85
+ select count(*) from net._http_response where error_msg ilike '%Timeout%';
86
+ """
87
+ )).fetchone ()
88
+ assert timed_out_count == 50
0 commit comments