Skip to content

Instantly share code, notes, and snippets.

@stash
Created January 9, 2012 22:58
Show Gist options
  • Select an option

  • Save stash/1585476 to your computer and use it in GitHub Desktop.

Select an option

Save stash/1585476 to your computer and use it in GitHub Desktop.
Strange out-of-memory
var vows = require('vows');
var assert = require('assert');
var https = require('https');
vows.describe("dies?").addBatch({
"pretend this is doing several https requests": {
topic: function() {
var cb = this.callback;
// https is important; http doesn't produce an error
var req = https.request({host:'encrypted.google.com',path:'/',method:'GET'}, function(res) {
res.on('end', function() { cb(null,[res]) });
});
req.on('error',cb);
req.end();
},
"got two responses": function(responses) {
assert.lengthOf(responses, 2); // <-- "FATAL ERROR: JS Allocation failed - process out of memory"
},
}
}).export(module);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment