Skip to content

Commit 8fb3f24

Browse files
author
Luca Forstner
authored
test: Fix flakey integration test (#13253)
1 parent b0d4926 commit 8fb3f24

File tree

1 file changed

+11
-1
lines changed
  • dev-packages/node-integration-tests/suites/express/multiple-init

1 file changed

+11
-1
lines changed

dev-packages/node-integration-tests/suites/express/multiple-init/server.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,17 @@ app.get('/test/error/:id', (req, res) => {
5252

5353
Sentry.captureException(new Error(`This is an exception ${id}`));
5454

55-
res.send({});
55+
setTimeout(() => {
56+
// We flush to ensure we are sending exceptions in a certain order
57+
Sentry.flush(3000).then(
58+
() => {
59+
res.send({});
60+
},
61+
() => {
62+
res.send({});
63+
},
64+
);
65+
}, 1000);
5666
});
5767

5868
Sentry.setupExpressErrorHandler(app);

0 commit comments

Comments
 (0)