test: fix some failing and disabled node specs (#19518)

* test: fix some failing and disabled node specs

These tests were failing due to mismatched stacktraces as a result of
our Module._load hook.  This fixes those by adding a flag to optionally
not hook those calls and instead do the asar override eagily.

* ELECTRON_EAGER_ASAR_HOOK => ELECTRON_EAGER_ASAR_HOOK_FOR_TESTING

* test: parallel/test-zlib-unused-weak consistently fails

Co-authored-by: Cheng Zhao <zcbenz@github.com>
This commit is contained in:
Samuel Attard 2020-01-14 23:07:03 -08:00 committed by Cheng Zhao
parent 49262b604d
commit b31c02ef31
3 changed files with 34 additions and 41 deletions

View file

@ -21,7 +21,8 @@ async function main () {
const testChild = cp.spawn('python', ['tools/test.py', '--verbose', '-p', 'tap', '--logfile', TAP_FILE_NAME, '--mode=debug', 'default', `--skip-tests=${DISABLED_TESTS.join(',')}`, '--shell', utils.getAbsoluteElectronExec(), '-J'], {
env: {
...process.env,
ELECTRON_RUN_AS_NODE: 'true'
ELECTRON_RUN_AS_NODE: 'true',
ELECTRON_EAGER_ASAR_HOOK_FOR_TESTING: 'true'
},
cwd: NODE_DIR,
stdio: 'inherit'