Comments (3)
That's definitely not good! A little hard to know exactly what's going on here, but let's try and narrow it down. A few initial questions jump to mind:
- is the issue reproducible outside the test environment? (e.g., would
cURL
-ing through the same steps taken by the test suite reproduce the error?) This seems unlikely given the error arose after changing dependencies, but if any other libs (or code) have changed recently it's worth ruling an environment-agnostic issue out. - if the test suite is open, can you provide a link to the failing specs? If not, can you provide additional detail (or sample tests) showing how the suite is structured (and particularly how sessions are being set up, used, and torn down)? If workers are being retained across the test suite and this is a matter of sessions piling up between tests, we might be able to resolve this by reaping more aggressively.
- how much memory does the application (counting master and worker processes separately) take during "normal" operation? If the application + test suite are just pushing up against the 512MB default limit, using
--max-old-space-size
will get it through.
from supertest-session.
The issue is purely related to supertest and/or supertest-session. Normal server environment works OK.
I was able to produce what perhaps is the problem leading to 'out of memory' error in a 'hello world' app. But since the app is very simple, it just produces a very large error output (too large to paste here).
To see, what I think is precursor to the memory problem, run
mocha test
You will see a very large error output. The error goes away if you
- Change the status code on express to 200 from 400, or
- Change the version of supertest-session to 0.0.7 (keeping the express status at 400)
package.json
{
"name": "",
"version": "1.0.0",
"private": true,
"dependencies": {
"express": "latest"
},
"devDependencies": {
"mocha": "latest",
"should": "latest",
"supertest-session": "latest"
}
}
app.js
var express = require('express');
var app = module.exports = express();
app.all('/', function (req, res) {
res.status(400).json({"hello":"world"});
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
test.js
"use strict";
var should = require('should');
var app = require('./app');
var Session = require('supertest-session')({app: app});
var asess1 = new Session();
describe('Test', function() {
describe('Test:', function() {
it('should fail on unexpected changes', function(done) {
asess1.get('/').end(function(err, res) {
should.not.exist(err);
done();
});
});
});
});
from supertest-session.
I just realized that I wasn't even using session in this test. I will report this issue upstream to supertest.
from supertest-session.
Related Issues (20)
- pass envs to application HOT 1
- Use conformant API
- legacySession is completely broken HOT 3
- Use superagent for cookie handling HOT 1
- Chaining problem when calling done inside expect HOT 1
- Promise wrapper method HOT 2
- Clarity in Readme HOT 6
- supertest-session is causing mocha test suite to hang HOT 8
- Tests fail for instantiated app
- Cannot retrieve session data stored in prior request HOT 7
- Test stops after when use authenticatedSession HOT 2
- NPM Audit report - Supertest version update. HOT 1
- Server sets two cookies during a request, supertest-session persists only one HOT 2
- Dependency declarations missing for clean load in Yarn PnP / Berry HOT 1
- having the same issue HOT 1
- Impossible to write on req.session
- Example in documentation does not work, because done is not called in before (and after) HOT 2
- Missing documentation for manipulating session BEFORE calling methods HOT 4
- Upgrade to use supertest 1.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supertest-session.