diff --git a/integration-tests/appsec/iast-esbuild.spec.js b/integration-tests/appsec/iast-esbuild.spec.js index 71e8de09c80..5d2fa9eb03e 100644 --- a/integration-tests/appsec/iast-esbuild.spec.js +++ b/integration-tests/appsec/iast-esbuild.spec.js @@ -17,7 +17,8 @@ describe('esbuild support for IAST', () => { let proc, agent, sandbox, axios let applicationDir, bundledApplicationDir - before(async () => { + before(async function () { + this.timeout(120_000) sandbox = await createSandbox([]) const cwd = sandbox.folder applicationDir = path.join(cwd, 'appsec/iast-esbuild') @@ -26,16 +27,33 @@ describe('esbuild support for IAST', () => { const craftedNodeModulesDir = path.join(applicationDir, 'tmp_node_modules') fs.mkdirSync(craftedNodeModulesDir) await exec('npm init -y', { cwd: craftedNodeModulesDir }) - await exec('npm install @datadog/wasm-js-rewriter @datadog/native-iast-taint-tracking', { - cwd: craftedNodeModulesDir, - timeout: 3e3 - }) - // Install app deps - await exec('npm install || npm install', { - cwd: applicationDir, - timeout: 6e3 - }) + try { + await exec('npm install @datadog/wasm-js-rewriter @datadog/native-iast-taint-tracking', { + cwd: craftedNodeModulesDir, + timeout: 3e3 + }) + } catch { + await exec('sleep 60') + await exec('npm install @datadog/wasm-js-rewriter @datadog/native-iast-taint-tracking', { + cwd: craftedNodeModulesDir, + timeout: 3e3 + }) + } + + try { + // Install app deps + await exec('npm install', { + cwd: applicationDir, + timeout: 6e3 + }) + } catch { + await exec('sleep 60') + await exec('npm install', { + cwd: applicationDir, + timeout: 6e3 + }) + } // Bundle the application await exec('npm run build', {