diff --git a/benchmark/sirun/run-all-variants.js b/benchmark/sirun/run-all-variants.js index 60f6a65992d..85894690354 100755 --- a/benchmark/sirun/run-all-variants.js +++ b/benchmark/sirun/run-all-variants.js @@ -14,25 +14,19 @@ const metaJson = require(path.join(process.cwd(), 'meta.json')) const env = Object.assign({}, process.env, { DD_TRACE_STARTUP_LOGS: 'false' }) ;(async () => { - try { - if (metaJson.variants) { - const variants = metaJson.variants - for (const variant in variants) { - const variantEnv = Object.assign({}, env, { SIRUN_VARIANT: variant }) - await exec('sirun', ['meta-temp.json'], { env: variantEnv, stdio: getStdio() }) - } - } else { - await exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() }) + if (metaJson.variants) { + const variants = metaJson.variants + for (const variant in variants) { + const variantEnv = Object.assign({}, env, { SIRUN_VARIANT: variant }) + await exec('sirun', ['meta-temp.json'], { env: variantEnv, stdio: getStdio() }) } + } else { + await exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() }) + } - try { - fs.unlinkSync(path.join(process.cwd(), 'meta-temp.json')) - } catch (e) { - // it's ok if we can't delete a temp file - } + try { + fs.unlinkSync(path.join(process.cwd(), 'meta-temp.json')) } catch (e) { - setImmediate(() => { - throw e // Older Node versions don't fail on uncaught promise rejections. - }) + // it's ok if we can't delete a temp file } })() diff --git a/benchmark/sirun/run-one-variant.js b/benchmark/sirun/run-one-variant.js index 77bb147c9e7..982c303ceae 100755 --- a/benchmark/sirun/run-one-variant.js +++ b/benchmark/sirun/run-one-variant.js @@ -8,12 +8,4 @@ process.env.DD_INSTRUMENTATION_TELEMETRY_ENABLED = 'false' const env = Object.assign({}, process.env, { DD_TRACE_STARTUP_LOGS: 'false' }) -;(async () => { - try { - await exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() }) - } catch (e) { - setImmediate(() => { - throw e // Older Node versions don't fail on uncaught promise rejections. - }) - } -})() +exec('sirun', ['meta-temp.json'], { env, stdio: getStdio() })