@newrelic/test-utilities
Advanced tools
Comparing version 6.5.3 to 6.5.4
@@ -17,3 +17,2 @@ #! /user/bin/env node | ||
const INSTALL_ATTEMPT_LIMIT = 3 | ||
const CHILD_TIMEOUT = 60 * 1000 // 1 minute | ||
@@ -76,5 +75,5 @@ const CHILD_KILL_TIMEOUT = 10 * 1000 // 10 seconds | ||
tryInstall(0) | ||
tryInstall() | ||
function tryInstall(attempts) { | ||
function tryInstall() { | ||
let args = [ | ||
@@ -90,22 +89,5 @@ 'install', | ||
if (err) { | ||
if (++attempts < INSTALL_ATTEMPT_LIMIT) { | ||
console.error('Clearing cache and retrying failed install...') | ||
setTimeout(function installRetry() { | ||
spawn('npm', ['cache', 'clean'], function cacheHandler(e) { | ||
if (e) { | ||
const error = new Error('Failed to clear cache: ' + e.stack) | ||
error.code = -Math.abs(e.code || 0xbeef) | ||
return cb(error) | ||
} | ||
tryInstall(attempts) | ||
}) | ||
}, 5000 * attempts) // 5 seconds * number of attempts | ||
return | ||
} | ||
const error = new Error('Failed to install packages: ' + err.stack) | ||
error.code = -Math.abs(err.code) | ||
return cb(error) | ||
err.code = -Math.abs(err.code) | ||
} | ||
cb() | ||
cb(err) | ||
}) | ||
@@ -112,0 +94,0 @@ } |
{ | ||
"name": "@newrelic/test-utilities", | ||
"version": "6.5.3", | ||
"version": "6.5.4", | ||
"description": "Test library for New Relic instrumentation modules.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87908
2037