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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/jquery-mousewheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: jQuery Mousewheel

on:
pull_request:
push:
branches:
- main

env:
NODE_VERSION: 22.x

jobs:
build-and-test:
runs-on: ubuntu-latest
name: Test jQuery Mousewheel Integration
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-

- name: Install dependencies
run: npm install

- name: Run jQuery Mousewheel tests
working-directory: test/jquery-mousewheel
run: npm it
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "test/jquery-ui"]
path = test/jquery-ui
url = [email protected]:jquery/jquery-ui.git
[submodule "test/jquery-mousewheel"]
path = test/jquery-mousewheel
url = [email protected]:jquery/jquery-mousewheel.git
8 changes: 4 additions & 4 deletions browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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().

workers[ fullBrowser ] = worker;

// Wait for the worker to show up in the list
// before returning it.
return ensureAcknowledged( worker );
// Wait for at least one response
// from the worker before continuing
await ensureAcknowledged( worker );
return worker;
}

export function touchBrowser( browser ) {
Expand Down
1 change: 1 addition & 0 deletions createTestServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export async function createTestServer( {
".txt": "text/plain",
".log": "text/plain"
};

use( async( req, res, next ) => {

// Allow serving anything but node_modules,
Expand Down
Loading