test: run interfering tests in their own process#1325
test: run interfering tests in their own process#1325gabrielschulhof wants to merge 1 commit intonodejs:mainfrom
Conversation
b63f9e7 to
983ebd2
Compare
|
Jenkins ci run on latest (main) - https://ci.nodejs.org/job/node-test-node-addon-api-new/7647/ jenkins ci run on earliest (16.x) - https://ci.nodejs.org/job/node-test-node-addon-api-new/7648/ |
test/addon_data.cc
Outdated
| // 0. A boolean named "verbose" is stored in the instance data. The constructor | ||
| // for JS `VerboseIndicator` instances is also stored in the instance data. | ||
| // 0. The constructor for JS `VerboseIndicator` instances, which have a private | ||
| // member named "verbose" is stored in the instance data. |
There was a problem hiding this comment.
| // member named "verbose" is stored in the instance data. | |
| // member named "verbose" stored in the instance data. |
There was a problem hiding this comment.
I meant to say that the constructor is stored on the instance data, so rather than remove the word "is", I need to put a comma in front of it.
test/common/index.js
Outdated
| // Capture the exit code and signal. | ||
| child | ||
| .on('exit', (code, signal) => maybeResolve({ code, signal })) | ||
| .on('close', () => maybeResolve()); |
There was a problem hiding this comment.
'close' event is always emitted after the 'exit' event (https://nodejs.org/api/child_process.html#event-close). So this can be simplified as:
| .on('close', () => maybeResolve()); | |
| .on('close', (code, signal) => resolve({ code, signal })); |
Tests such as addon and addon_data both use SetInstanceData. Thus, they overwrite each other's instance data. We change them both to run in a child process such that they do not call SetInstanceData on init, but rather they return a JS function on init which, when called, produces the actual binding which needs SetInstanceData. We also introduce a utility function for launching a test in its own child process for the purpose of running tests that would otherwise interfere with each other.
1de5ef4 to
38061b3
Compare
Tests such as addon and addon_data both use SetInstanceData. Thus, they overwrite each other's instance data. We change them both to run in a child process such that they do not call SetInstanceData on init, but rather they return a JS function on init which, when called, produces the actual binding which needs SetInstanceData. We also introduce a utility function for launching a test in its own child process for the purpose of running tests that would otherwise interfere with each other. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: #1325 Reviewed-By: Chengzhong Wu <[email protected]>
|
Landed in 414be9e. |
Tests such as addon and addon_data both use SetInstanceData. Thus, they overwrite each other's instance data. We change them both to run in a child process such that they do not call SetInstanceData on init, but rather they return a JS function on init which, when called, produces the actual binding which needs SetInstanceData. We also introduce a utility function for launching a test in its own child process for the purpose of running tests that would otherwise interfere with each other. Signed-off-by: Gabriel Schulhof <[email protected]> PR-URL: nodejs/node-addon-api#1325 Reviewed-By: Chengzhong Wu <[email protected]>
Tests such as addon and addon_data both use SetInstanceData. Thus, they overwrite each other's instance data. We change them both to run in a child process such that they do not call SetInstanceData on init, but rather they return a JS function on init which, when called, produces the actual binding which needs SetInstanceData.
We also introduce a utility function for launching a test in its own child process for the purpose of running tests that would otherwise interfere with each other.