Skip to content

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

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

timmywil
Copy link
Member

@timmywil timmywil commented Mar 11, 2025

  • 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.
  • upgraded dependencies

@timmywil timmywil force-pushed the quick_selenium branch 5 times, most recently from e1ad506 to 992472d Compare March 11, 2025 02:42
…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.
// but don't wait for the page to load
// so the worker is set up in time
// for the ack request.
driver.get( url );
Copy link
Member Author

@timmywil timmywil Mar 11, 2025

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.

@timmywil timmywil requested a review from mgol March 11, 2025 02:46
@@ -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 ];
Copy link
Member Author

@timmywil timmywil Mar 11, 2025

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 );
Copy link
Member Author

@timmywil timmywil Mar 11, 2025

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().

@timmywil timmywil changed the title fix(browsers): ensuring acknowledgement is only necessary for browserstack fix(browsers): get worker up and running in time to receive sync ack requests Mar 11, 2025
@timmywil timmywil changed the title fix(browsers): get worker up and running in time to receive sync ack requests fix(browsers): get worker up and running in time to receive quick ack requests Mar 11, 2025
@timmywil timmywil merged commit f5382b3 into main Mar 11, 2025
6 checks passed
@timmywil timmywil deleted the quick_selenium branch March 11, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants