-
Notifications
You must be signed in to change notification settings - Fork 9.5k
tests(smoke): run bundle smokes in a worker #13947
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
Conversation
return { | ||
lhr: result.lhr, | ||
artifacts: result.artifacts, | ||
log, |
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.
also we get logs now
if (typeof globalThis === 'undefined') { | ||
// @ts-expect-error - exposing for loading of dt-bundle. | ||
global.globalThis = global; | ||
if (!isMainThread && parentPort) { |
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.
I'm kinda on the fence about having this in a single file. It's nice to have a single file for all of our bundled smoke stuff, but it also means you have to read the same file in two different contexts. Is having the worker stuff in the same file necessary for this to work?
At the very least, can we highlight the "worker" section and the "main thread" section with comments?
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.
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.
FWIW, since the worker only does one thing and then dies, it doesn't actually need to receive messages. The worker can just load from workerData
and get rid of some of this complexity.
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.
Looks like you can merge from master to solve CI, LGTM
global.globalThis = global; | ||
// This runs only in the worker. The rest runs on the main thread. | ||
if (!isMainThread && parentPort) { | ||
(async () => { |
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.
technically don't we have top-level await? We might not want to break that seal yet, though
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.
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.
Last comments are just style variations on what you already have, so take anything or leave it. Change looks great!
This allows us to run these tests in parallel now.
ref #13943 (comment)