-
Notifications
You must be signed in to change notification settings - Fork 75
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
Async Runner with Message Channel #458
base: main
Are you sure you want to change the base?
Async Runner with Message Channel #458
Conversation
resources/test-invoker.mjs
Outdated
|
||
export const ASYNC_TEST_INVOKER_LOOKUP = { | ||
__proto__: null, | ||
timer: AsyncTimerTestInvoker, |
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.
If we don't want an AsyncTimerTestInvoker, I could simply assign the same AsyncRAFTestInvoker..
resources/tests.mjs
Outdated
@@ -125,6 +125,7 @@ Suites.push({ | |||
name: "TodoMVC-JavaScript-ES5", | |||
url: "resources/todomvc/vanilla-examples/javascript-es5/dist/index.html", | |||
tags: ["todomvc"], | |||
type: "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.
So in practice all the tests are now 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.
This can be reverted. For testing I marked all default tests async.
How do we decide which tests should be async? I know React / Next.js had issues with not capturing all work. Those could be candidates to mark 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.
Those being async sounds good, and perhaps everything in the future should be async by default.
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'll leave it unchanged (opting every single workload into async steps), until I get more feedback from other folks.
Looks reasonable. @julienw do you think you could have this in some public place for testing? I could do some profiling to check if there is anything unexpected happening. |
resources/test-invoker.mjs
Outdated
@@ -24,7 +24,24 @@ export class TimerTestInvoker extends TestInvoker { | |||
} | |||
} | |||
|
|||
export class RAFTestInvoker extends TestInvoker { |
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'd prefer removing the TimerTestInvoker entirely since we've moved to RAF-based measurement in 3 and we haven't seen any issue with it.
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.
removed!
Can we split the change to remove |
b24aa1c
to
acc7522
Compare
ok, reverted for now. I agree a cleanup pr to remove this would be better. |
@smaug---- I pushed this to https://feature-async-runner-message-channel--speedometer-preview.netlify.app/ for anyone who wants to test. |
resources/shared/test-runner.mjs
Outdated
return `${this.#suite.name}.${this.#test.name}-sync-end`; | ||
} | ||
|
||
get asyncStartLabel() { |
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.
Do we really need to add all these getters now that we're only overriding _runSyncStep?
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 can revert this.
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.
done
@@ -24,7 +24,24 @@ export class TimerTestInvoker extends TestInvoker { | |||
} | |||
} | |||
|
|||
export class RAFTestInvoker extends TestInvoker { | |||
class AsyncTimerTestInvoker extends TestInvoker { |
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.
Can we instead just delete TimerTestInvoker
as we discussed in a separate PR?
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.
We wanted to do this in a follow up pr, correct?
If that changed, i'm happy to remove it in this pr already.
@@ -75,7 +75,8 @@ export class SuiteRunner { | |||
if (this.#client?.willRunTest) | |||
await this.#client.willRunTest(this.#suite, test); | |||
|
|||
const testRunner = new TestRunner(this.#frame, this.#page, this.#params, this.#suite, test, this._recordTestResults); | |||
const testRunnerClass = TEST_RUNNER_LOOKUP[this.#suite.type ?? "default"]; |
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.
Instead of changing the test runner based on the suite type for some suites, can we initially add a toggle to developer menu so that we can try out async runner?
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.
To my understanding the agreement in the meeting was to unconditionally enable the new runner for the preact workloads and add the global developer-mode menu in a separate PR.
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.
correct - below is the list on enabled suites (for now):
- TodoMVC-React-Complex-DOM,
- TodoMVC-React-Redux,
- TodoMVC-Preact-Complex-DOM, (technically not react based, but it's similar)
- NewsSite-Next,
- React-Stockcharts-SVG
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.
If we're doing that, we need before/after numbers across browsers.
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'll run crossbench for the ones on the list and post results here.
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.
As discussed in our sync, here is a combination of the AsyncRunner and Message Channel pr.
Relevant code snippet (udpated):
For testing purposes I kept an explicit type of "async" in the test file, but I opted all default suites into using it.
Initial testing shows that it should also fix the react specific issue.
Other issue solved by this pr: #83