Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
run: npm ci

- name: Run tests
run: npm run test
run: npm run test:ci

- name: Move MySQLMSN directory for GitHub Actions upload
if: ${{ failure() }}
env:
MOVE_MYSQLMSN_TO: /tmp/mysqlmsn
run: npx ts-node tests/ci/DirMoveGitHubActions.ts

- name: Upload mysqlmsn directory (Not Windows)
- name: Upload mysqlmsn directory
if: ${{ failure() }}
uses: actions/upload-artifact@v4.3.5
with:
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/node-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ on:

jobs:
node:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-14, macos-15, macos-15-intel, macos-26, ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025, ubuntu-22.04-arm, ubuntu-24.04-arm, windows-11-arm]
node-version: [18.x, 19.x, 20.x, 21.x, 22.x, 23.x, 24.x, 25.x]
# Exclude Node 18.x on Windows on Arm because Node only provides Windows on Arm binaries for Node >= 19
exclude:
- os: windows-11-arm
node-version: 18.x

steps:
- name: Checkout
Expand All @@ -31,10 +36,16 @@ jobs:
- name: Run tests
run: npm run test:ci

- name: Move MySQLMSN directory for GitHub Actions upload
if: ${{ failure() }}
env:
MOVE_MYSQLMSN_TO: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
run: npx ts-node tests/ci/DirMoveGitHubActions.ts

- name: Upload mysqlmsn directory
if: ${{ failure() }}
uses: actions/upload-artifact@v4.3.5
with:
name: node-${{ matrix.node-version }}
path: /tmp/mysqlmsn
path: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
compression-level: 9
12 changes: 10 additions & 2 deletions .github/workflows/old-node-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:

jobs:
node:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [16.6.0, 16.x, 17.0.0, 17.x]
# windows-11-arm is not included here because Node only has Windows on Arm binaries for Node >= 19
os: [macos-14, macos-15, macos-15-intel, macos-26, ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025, ubuntu-22.04-arm, ubuntu-24.04-arm]

steps:
- name: Checkout
Expand All @@ -31,10 +33,16 @@ jobs:
- name: Run tests
run: npx ts-node tests/old-node.ts

- name: Move MySQLMSN directory for GitHub Actions upload
if: ${{ failure() }}
env:
MOVE_MYSQLMSN_TO: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
run: npx ts-node tests/ci/DirMoveGitHubActions.ts

- name: Upload mysqlmsn directory
if: ${{ failure() }}
uses: actions/upload-artifact@v4.3.5
with:
name: node-${{ matrix.node-version }}
path: /tmp/mysqlmsn
path: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
compression-level: 9
16 changes: 4 additions & 12 deletions .github/workflows/os-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,12 @@ jobs:
MOVE_MYSQLMSN_TO: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
run: npx ts-node tests/ci/DirMoveGitHubActions.ts

- name: Upload mysqlmsn directory (Windows)
if: ${{ failure() && runner.os == 'Windows' }}
uses: actions/upload-artifact@v4.3.5
with:
name: ${{ matrix.os }}-${{ matrix.version-requirement }}
path: "C:\\Users\\RUNNER~1\\mysqlmsn"
compression-level: 9

- name: Upload mysqlmsn directory (Not Windows)
if: ${{ failure() && runner.os != 'Windows' }}
- name: Upload mysqlmsn directory
if: ${{ failure() }}
uses: actions/upload-artifact@v4.3.5
with:
name: ${{ matrix.os }}-${{ matrix.version-requirement }}
path: /tmp/mysqlmsn
name: node-${{ matrix.node-version }}
path: ${{ runner.os == 'Windows' && 'C:\\Users\\RUNNER~1\\mysqlmsn' || '/tmp/mysqlmsn' }}
compression-level: 9

fedora-docker:
Expand Down
14 changes: 9 additions & 5 deletions src/libraries/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ class Executor {
})
}

async #killProcess(process: ChildProcess): Promise<boolean> {
async #killProcess(childProcess: ChildProcess): Promise<boolean> {
// If the process has already been killed, return true
if (process.kill(0) === false) {
this.logger.warn('Called #killProcess to kill mysqld but it has already been killed.')
const pid = childProcess.pid

try {
process.kill(pid, 0)
} catch (e) {
this.logger.warn('#killProcess got called to kill mysqld but it is not running:', e)
return true
}

if (os.platform() === 'win32') {
const {error, stderr} = await this.#executeFile('taskkill', ['/pid', String(process.pid), '/t', '/f'])
const {error, stderr} = await this.#executeFile('taskkill', ['/pid', String(pid), '/t', '/f'])
const message = error || stderr

if (!message) {
Expand All @@ -59,7 +63,7 @@ class Executor {
return false
}

return process.kill('SIGKILL')
return process.kill(pid, 'SIGKILL')
}

//Returns a path to the binary if it should be deleted
Expand Down