From f8c5511c5b5b432eb0823790264b8cc1144817bf Mon Sep 17 00:00:00 2001 From: Roch Devost Date: Tue, 28 Oct 2025 13:09:27 -0400 Subject: [PATCH 1/2] fix missing retry on npm install of wasm-js-rewriter --- integration-tests/appsec/iast-esbuild.spec.js | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/integration-tests/appsec/iast-esbuild.spec.js b/integration-tests/appsec/iast-esbuild.spec.js index 71e8de09c80..992fa1bf222 100644 --- a/integration-tests/appsec/iast-esbuild.spec.js +++ b/integration-tests/appsec/iast-esbuild.spec.js @@ -18,6 +18,7 @@ describe('esbuild support for IAST', () => { let applicationDir, bundledApplicationDir before(async () => { + 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', { From e1e8714a8a680fa79219e0b70df9ecb7f101aec2 Mon Sep 17 00:00:00 2001 From: Roch Devost Date: Tue, 28 Oct 2025 13:28:38 -0400 Subject: [PATCH 2/2] fix before hook --- integration-tests/appsec/iast-esbuild.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/appsec/iast-esbuild.spec.js b/integration-tests/appsec/iast-esbuild.spec.js index 992fa1bf222..5d2fa9eb03e 100644 --- a/integration-tests/appsec/iast-esbuild.spec.js +++ b/integration-tests/appsec/iast-esbuild.spec.js @@ -17,7 +17,7 @@ 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