mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: reduce number of written chunks
Reduce chances of write errors while the request is sent. Refs: https://github.com/nodejs/node/pull/56756 PR-URL: https://github.com/nodejs/node/pull/56757 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
This commit is contained in:
@@ -55,10 +55,12 @@ server.listen(0, common.mustCall(() => {
|
||||
|
||||
sendDelayedRequestHeaders = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
client.write('POST / HTTP/1.1\r\n');
|
||||
client.write('Content-Length: 20\r\n');
|
||||
client.write('Connection: close\r\n\r\n');
|
||||
client.write('12345678901234567890\r\n\r\n');
|
||||
client.write(
|
||||
'POST / HTTP/1.1\r\n' +
|
||||
'Content-Length: 20\r\n' +
|
||||
'Connection: close\r\n\r\n' +
|
||||
'12345678901234567890\r\n\r\n'
|
||||
);
|
||||
}, common.platformTimeout(headersTimeout * 2)).unref();
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -52,9 +52,11 @@ server.listen(0, common.mustCall(() => {
|
||||
}));
|
||||
|
||||
client.resume();
|
||||
client.write('GET / HTTP/1.1\r\n');
|
||||
client.write('Connection: close\r\n');
|
||||
client.write('X-CRASH: ');
|
||||
client.write(
|
||||
'GET / HTTP/1.1\r\n' +
|
||||
'Connection: close\r\n' +
|
||||
'X-CRASH: '
|
||||
);
|
||||
|
||||
sendDelayedRequestHeaders = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -59,11 +59,12 @@ server.listen(0, common.mustCall(() => {
|
||||
}));
|
||||
|
||||
client.resume();
|
||||
client.write('POST / HTTP/1.1\r\n');
|
||||
client.write('Host: example.com\r\n');
|
||||
client.write('Content-Length: 20\r\n');
|
||||
client.write('Connection: close\r\n');
|
||||
client.write('\r\n');
|
||||
client.write(
|
||||
'POST / HTTP/1.1\r\n' +
|
||||
'Host: example.com\r\n' +
|
||||
'Content-Length: 20\r\n' +
|
||||
'Connection: close\r\n\r\n'
|
||||
);
|
||||
|
||||
sendDelayedRequestBody = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -50,10 +50,12 @@ server.listen(0, common.mustCall(() => {
|
||||
|
||||
sendDelayedRequestHeaders = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
client.write('POST / HTTP/1.1\r\n');
|
||||
client.write('Content-Length: 20\r\n');
|
||||
client.write('Connection: close\r\n\r\n');
|
||||
client.write('12345678901234567890\r\n\r\n');
|
||||
client.write(
|
||||
'POST / HTTP/1.1\r\n' +
|
||||
'Content-Length: 20\r\n' +
|
||||
'Connection: close\r\n\r\n' +
|
||||
'12345678901234567890\r\n\r\n'
|
||||
);
|
||||
}, common.platformTimeout(requestTimeout * 2)).unref();
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -59,12 +59,13 @@ server.listen(0, common.mustCall(() => {
|
||||
}));
|
||||
|
||||
client.resume();
|
||||
client.write('POST / HTTP/1.1\r\n');
|
||||
client.write('Host: example.com\r\n');
|
||||
client.write('Content-Length: 20\r\n');
|
||||
client.write('Connection: close\r\n');
|
||||
client.write('\r\n');
|
||||
client.write('1234567890');
|
||||
client.write(
|
||||
'POST / HTTP/1.1\r\n' +
|
||||
'Host: example.com\r\n' +
|
||||
'Content-Length: 20\r\n' +
|
||||
'Connection: close\r\n\r\n' +
|
||||
'1234567890'
|
||||
);
|
||||
|
||||
sendDelayedRequestBody = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -47,9 +47,11 @@ server.listen(0, common.mustCall(() => {
|
||||
}));
|
||||
|
||||
client.resume();
|
||||
client.write('GET / HTTP/1.1\r\n');
|
||||
client.write('Connection: close\r\n');
|
||||
client.write('X-CRASH: ');
|
||||
client.write(
|
||||
'GET / HTTP/1.1\r\n' +
|
||||
'Connection: close\r\n' +
|
||||
'X-CRASH: '
|
||||
);
|
||||
|
||||
sendDelayedRequestHeaders = common.mustCall(() => {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user