Skip to content

fix(node): Fix for manual tests in node #3428

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

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/node/test/manual/apm-transaction/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ app.get('/trace', async (_req, res, next) => {
app.use(Tracing.finish());
app.use(Sentry.Handlers.errorHandler());

const server = app.listen(1231, () => {
http.get('http://localhost:1231/trace', res => {
const server = app.listen(0, () => {
const port = server.address().port;
http.get(`http://localhost:${port}/trace`, res => {
server.close();
});
});
12 changes: 7 additions & 5 deletions packages/node/test/manual/express-scope-separation/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DummyTransport {

if (!remaining) {
console.error('SUCCESS: All scopes contain correct tags');
server.close();
process.exit(0);
}

Expand Down Expand Up @@ -83,8 +84,9 @@ app.get('/baz', req => {

app.use(Sentry.Handlers.errorHandler());

app.listen(1121);

http.get('http://localhost:1121/foo');
http.get('http://localhost:1121/bar');
http.get('http://localhost:1121/baz');
const server = app.listen(0, () => {
const port = server.address().port;
http.get(`http://localhost:${port}/foo`);
http.get(`http://localhost:${port}/bar`);
http.get(`http://localhost:${port}/baz`);
});
5 changes: 3 additions & 2 deletions packages/node/test/manual/memory-leak/express-patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ app.use((err, req, res, next) => {
return res.status(500).send('oh no there was an error: ' + err.message);
});

const server = app.listen(5140, () => {
process._rawDebug('patient is waiting to be poked on port 5140');
const server = app.listen(0, () => {
const port = server.address().port;
process._rawDebug(`patient is waiting to be poked on port ${port}`);
memwatch.gc();
});