Skip to content

Commit 3d9bba7

Browse files
committed
fixxeeesss
1 parent c08ecc6 commit 3d9bba7

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

dev-packages/node-overhead-gh-action/lib/getOverheadMeasurements.mjs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { fileURLToPath } from 'url';
44

55
const DEBUG = !!process.env.DEBUG;
66

7-
const __dirname = dirname(fileURLToPath(import.meta.url));
7+
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), '..');
88

99
async function getMeasurements(instrumentFile) {
10-
const args = [join(__dirname, '../src/app.mjs')];
10+
const args = [join(packageRoot, './src/app.mjs')];
1111

1212
if (instrumentFile) {
13-
args.unshift('--import', join(__dirname, '..', instrumentFile));
13+
args.unshift('--import', join(packageRoot, instrumentFile));
1414
}
1515

1616
const cmd = `node ${args.join(' ')}`;
@@ -32,13 +32,15 @@ async function getMeasurements(instrumentFile) {
3232
appProcess.stderr.on('data', data => {
3333
log(`appProcess stderr: ${data}`);
3434
reject(data);
35+
appProcess.kill();
3536
});
3637
});
3738

3839
log('Example app listening, running autocannon...');
3940

4041
const autocannon = spawn('yarn test', {
4142
shell: true,
43+
cwd: packageRoot,
4244
});
4345

4446
let lastJson = undefined;
@@ -51,11 +53,13 @@ async function getMeasurements(instrumentFile) {
5153
}
5254
});
5355

54-
autocannon.stderr.on('data', data => {
55-
log(`autocannon stderr: ${data}`);
56-
});
56+
return new Promise((resolve, reject) => {
57+
autocannon.stderr.on('data', data => {
58+
log(`autocannon stderr: ${data}`);
59+
autocannon.kill();
60+
reject(data);
61+
});
5762

58-
return new Promise(resolve => {
5963
autocannon.on('close', code => {
6064
log(`autocannon closed with code ${code}`);
6165

dev-packages/node-overhead-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"fix": "eslint . --format stylish --fix"
2020
},
2121
"dependencies": {
22-
"@sentry/node": "10.7.0",
22+
"@sentry/node": "10.8.0",
2323
"express": "^4.21.1"
2424
},
2525
"devDependencies": {

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6932,7 +6932,7 @@
69326932
mitt "^3.0.0"
69336933

69346934
"@sentry-internal/test-utils@link:dev-packages/test-utils":
6935-
version "10.7.0"
6935+
version "10.8.0"
69366936
dependencies:
69376937
express "^4.21.1"
69386938

0 commit comments

Comments
 (0)