From c782c3dc69b1f4286e3cd8b60840fa213fe499c0 Mon Sep 17 00:00:00 2001 From: KrayzeeKev Date: Wed, 20 Jul 2022 10:44:26 +1000 Subject: [PATCH] test: ensure NODE_EXTRA_CA_CERTS not set before tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'test-tls-env-extra-ca-file-load.js' test assumes that NODE_EXTRA_CA_CERTS is not set. If the build environment happens to have it set, this test will fail. This change deletes that env var before running the test. PR-URL: https://github.com/nodejs/node/pull/43858 Reviewed-By: Tobias Nießen Reviewed-By: Michaël Zasso Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- test/parallel/test-tls-env-extra-ca-file-load.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-tls-env-extra-ca-file-load.js b/test/parallel/test-tls-env-extra-ca-file-load.js index 75d7c17c1f1ee3..c66499a55d00e4 100644 --- a/test/parallel/test-tls-env-extra-ca-file-load.js +++ b/test/parallel/test-tls-env-extra-ca-file-load.js @@ -20,6 +20,8 @@ if (process.argv[2] !== 'child') { const NODE_EXTRA_CA_CERTS = fixtures.path('keys', 'ca1-cert.pem'); const extendsEnv = (obj) => ({ ...process.env, ...obj }); + // Remove any pre-existing extra CA certs. + delete process.env.NODE_EXTRA_CA_CERTS; [ extendsEnv({ CHILD_USE_EXTRA_CA_CERTS: 'yes', NODE_EXTRA_CA_CERTS }), extendsEnv({ CHILD_USE_EXTRA_CA_CERTS: 'no' }),