diff --git a/scripts/test-launch-with-different-databases.js b/scripts/test-launch-with-different-databases.js index fefcf41..1880bbe 100644 --- a/scripts/test-launch-with-different-databases.js +++ b/scripts/test-launch-with-different-databases.js @@ -52,5 +52,4 @@ async function main() { main().catch((ex) => { console.warn(ex) - process.exit(1) }) diff --git a/scripts/util/database/mariadb.js b/scripts/util/database/mariadb.js index a7a91e2..e75a8a8 100644 --- a/scripts/util/database/mariadb.js +++ b/scripts/util/database/mariadb.js @@ -64,7 +64,11 @@ async function startMariadb() { } return { - shutdown: () => task.kill('SIGINT'), + shutdown: () => { + spawnAsync('mysql', ['-S', socketPath, '-u', 'root', '-e', 'SHUTDOWN;'], { stdio: 'inherit' }).catch((ex) => { + console.warn(ex) + }) + }, socketPath, dataDir, database, diff --git a/scripts/util/mainapp.js b/scripts/util/mainapp.js index 141b154..8112af2 100644 --- a/scripts/util/mainapp.js +++ b/scripts/util/mainapp.js @@ -16,12 +16,15 @@ */ const { spawn } = require('child_process') +const { resolve } = require('path') function startMainApp(env) { + const initPath = resolve(__dirname, '../../build/index.js') + return new Promise((resolve, reject) => { - const task = spawn('npm', ['start'], { + const task = spawn('node', [initPath], { stdio: ['inherit', 'pipe', 'inherit'], - env: { ...process.env, PORT: 0 /* random port */, ...env } + env: { ...process.env, PORT: 0 /* random port */ } }) task.on('exit', () => reject(new Error('task terminated too early')))