Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Add manual memory test for parseStack concurrency explosion on large …
Browse files Browse the repository at this point in the history
…module
  • Loading branch information
LewisJEllis committed May 17, 2017
1 parent 1e883b4 commit 33bf844
Show file tree
Hide file tree
Showing 5 changed files with 5,040 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
coverage/
test/instrumentation/node-*
test/manual/largeModule.js
18 changes: 18 additions & 0 deletions test/manual/express-patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ app.get('/capture', function (req, res, next) {
next();
});

app.get('/capture_large_source', function (req, res, next) {
nockRequest();

// largeModule.run recurses 1000 times, largeModule is a 5MB file
// if we read the largeModule source once for each frame, we'll use a ton of memory
var largeModule = require('./largeModule');

try {
largeModule.run();
} catch (e) {
Raven.captureException(e);
}

memwatch.gc();
res.textToSend = 'capturing an exception!';
next();
});

app.use(function (req, res, next) {
if (req.query.doError) {
nockRequest();
Expand Down

0 comments on commit 33bf844

Please sign in to comment.