-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails on node v4 #104
Comments
I was able to reproduce this issue without wreck... here is the issue: var Http = require('http');
var Fs = require('fs');
var Url = require('url');
var server = Http.createServer(function (req, res) {
res.writeHead(200);
res.end();
});
server.listen(8080);
var uri = Url.parse('http://localhost:8080/');
uri.method = 'post';
var req = Http.request(uri);
var stream = Fs.createReadStream(__dirname + '/images/wreck.png');
stream.pipe(req); There seems to be a limit around 16kb on the size of payloads that work vs break. |
This seems like a node issue, though not something that is likely to happen under normal circumstances. As far as I can tell, it happens if the reply is processed before the request is completed. In your example it can be "fixed" by scheduling |
I can change the tests to be under 16kb when sending a payload, which will fix the tests. |
This fixes all tests for me: diff --git a/test/index.js b/test/index.js
index 74a1dea..d70ba13 100755
--- a/test/index.js
+++ b/test/index.js
@@ -535,17 +535,20 @@ describe('request()', function () {
var gen = 0;
var server = Http.createServer(function (req, res) {
- if (!gen++) {
- res.writeHead(307, { 'Location': '/' });
- res.end();
- }
- else {
- res.writeHead(200, { 'Content-Type': 'text/plain' });
- Wreck.read(req, null, function (err, res2) {
+ process.nextTick(function () {
- res.end(res2);
- });
- }
+ if (!gen++) {
+ res.writeHead(307, { 'Location': '/' });
+ res.end();
+ }
+ else {
+ res.writeHead(200, { 'Content-Type': 'text/plain' });
+ Wreck.read(req, null, function (err, res2) {
+
+ res.end(res2);
+ });
+ }
+ });
});
server.listen(0, function () { |
Isn't it related to nodejs/node#2355 ? |
The real question is if this indicates a problem with node v4 or just something minor we can fix in our own tests. The existing failing code looks legit to me. |
@geek and @lloydbenson talked to some core contributors at nodeconfeu and should be working on a test case soon, that's probably up to node to fix it. |
I logged an issue here: nodejs/node#2821 |
Workaround for issue is in 6633ff5 |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Also 84 and 85.
The text was updated successfully, but these errors were encountered: