-
Notifications
You must be signed in to change notification settings - Fork 1
fix(browsers): get worker up and running in time to receive quick ack requests #12
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
e1ad506
to
992472d
Compare
…stack - short and quick selenium runs can send all xhr requests before the acknowledger can get lined up to listen for them. This was the case with jquery-mousewheel, which has been added in the tests.
992472d
to
2cfcb26
Compare
// but don't wait for the page to load | ||
// so the worker is set up in time | ||
// for the ack request. | ||
driver.get( url ); |
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 is the important change. It was waiting for the load event, but all of the mousewheel scripts are loaded synchronously in the head. They executed so quickly that all of the events were received before the worker was added to the list.
@@ -80,10 +80,14 @@ export async function run( { | |||
quiet: true, // Quiet server logs during test runs | |||
testUrls, | |||
report: async( message ) => { | |||
const reportId = message.id; | |||
const report = reports[ reportId ]; |
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 change was left over after some debugging, but it's a bit more dry so I liked it.
@@ -103,12 +103,12 @@ export async function createBrowserWorker( url, browser, options, restarts = 0 ) | |||
worker.browser = browser; | |||
worker.restarts = restarts; | |||
worker.options = options; | |||
touchBrowser( browser ); |
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 touch was never actually applied. The following line added the worker to the list, which is needed in touchBrowser
. It isn't necessary anyway and would have been immediately deleted in waitForAck()
.
Uh oh!
There was an error while loading. Please reload this page.