Mercurial > hg > nginx-tests
comparison stream_js_exit.t @ 1662:7f1579e4372a
Tests: fixed stream js exit tests introduced in 69d71a15d407.
Previously, the tests relied upon the following assumption: two
consecutive syswrite() in stream_daemon will be received as a single
data chunk in stream which is not always the case.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Sat, 06 Mar 2021 12:21:28 +0000 |
parents | 69d71a15d407 |
children | 7cf848422b28 |
comparison
equal
deleted
inserted
replaced
1661:69d71a15d407 | 1662:7f1579e4372a |
---|---|
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 EOF | 70 EOF |
71 | 71 |
72 my $p = port(8080); | |
73 | |
74 $t->write_file('test.js', <<EOF); | 72 $t->write_file('test.js', <<EOF); |
75 function test_njs(r) { | 73 function test_njs(r) { |
76 r.return(200, njs.version); | 74 r.return(200, njs.version); |
77 } | 75 } |
78 | 76 |
138 | 136 |
139 $client->sysread(my $buffer, 65536) or next; | 137 $client->sysread(my $buffer, 65536) or next; |
140 | 138 |
141 log2i("$client $buffer"); | 139 log2i("$client $buffer"); |
142 | 140 |
141 $buffer = $buffer . $buffer; | |
142 | |
143 log2o("$client $buffer"); | 143 log2o("$client $buffer"); |
144 | 144 |
145 $client->syswrite($buffer); | |
146 $client->syswrite($buffer); | 145 $client->syswrite($buffer); |
147 | 146 |
148 close $client; | 147 close $client; |
149 } | 148 } |
150 } | 149 } |