-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: update tests to avoid running in parallel #1024
Conversation
fixes: nodejs#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>
@nodejs/node-api anybody have a windows machine who can check what's up with the symbol test on windows? I'm not sure how the change would have broken just for windows? |
Hi @mhdawson, 'use strict'
const assert = require('assert')
const symbols = ['iterator', 'matchAll']
for (const symbol of symbols) {
const symbOne = Symbol.for(symbol);
const symbTwo = Symbol.for(symbol);
assert(symbOne && symbTwo);
assert(symbOne === symbTwo);
}
for (const symbol of symbols) {
const symbOne = global.Symbol[symbol]
const symbTwo = global.Symbol[symbol]
assert(symbOne && symbTwo);
assert(symbOne === symbTwo);
} In the example above the second series of test fails. This happens becasue inline Symbol Symbol::WellKnown(napi_env env, const std::string& name) {
return Napi::Env(env).Global().Get("Symbol").As<Object>().Get(name).As<Symbol>();
} To obtain a well-known symbols we try to get it from the global object. |
@NickNaso thanks! Strange that it is found on linux but not windows. |
test/common/index.js
Outdated
@@ -101,3 +101,10 @@ exports.runTestWithBindingPath = async function(test, buildType) { | |||
await test(item); | |||
} | |||
} | |||
|
|||
exports.runTestNoBinding = async function(test, buildType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above two helpers are named with their parameters:
runTest(test: (binding) => Promise<void>)
runTestWithBindingPath(test: (bindingPath) => Promise<void>)
Maybe we can name this as runTestWithBuildType
so that we can assume the first parameter of the test function is buildType
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@legendecas that makes sense to me will update.
@NickNaso this is what I see on linux [midawson@drx-hemera node]$ cat test.js
console.log(global.Symbol.matchAll);
console.log(global.Symbol['matchAll']);
[midawson@drx-hemera node]$ ./node test.js
Symbol(Symbol.matchAll)
Symbol(Symbol.matchAll) From what I understand you get undefined on windows instead, right ? |
@NickNaso, I thinkI understand you now, sounds like we should only test for that symbol on 12.x and above |
Yes on Windows, but only with Node.js 10.x I get |
Only check for the matchAll symbol on 12.x and above Signed-off-by: Michael Dawson <[email protected]>
Signed-off-by: Michael Dawson <[email protected]>
fixes: #1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: #1024 Reviewed-By: Chengzhong Wu <[email protected]>
Landed as a459f5c |
fixes: nodejs#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: nodejs#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: nodejs/node-addon-api#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs/node-addon-api#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: nodejs/node-addon-api#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs/node-addon-api#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: nodejs/node-addon-api#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs/node-addon-api#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: nodejs/node-addon-api#1022 The objectwrap_worker_thread and symbol tests were not waiting for the test to complete before the subsequent tests were started. This caused intermitted crashes in the CI. Updated both tests so that they complete before the next test runs. Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs/node-addon-api#1024 Reviewed-By: Chengzhong Wu <[email protected]>
fixes: #1022
The objectwrap_worker_thread and symbol tests
were not waiting for the test to complete before the
subsequent tests were started. This caused intermittent
crashes in the CI.
Updated both tests so that they complete before the
next test runs.
Signed-off-by: Michael Dawson [email protected]