diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index d92260f..1e471ea 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -80,21 +80,6 @@ jobs: npm start -- createcd --input test/fixtures/cue/multiple.cue --output multiple.chd --hunksize 14688 npm start -- info --input multiple.chd - node-e2e: - needs: - - path-filter - if: ${{ needs.path-filter.outputs.changes == 'true' }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, macos-13, macos-14, windows-latest ] - steps: - # Setup and install - - uses: actions/checkout@v4 - - uses: volta-cli/action@v4 - - run: npm ci - # Test - # !!! This check should be required by GitHub !!! test-status-check: if: always() diff --git a/src/chdman/chdmanBin.ts b/src/chdman/chdmanBin.ts index 6de5664..7b73f6e 100644 --- a/src/chdman/chdmanBin.ts +++ b/src/chdman/chdmanBin.ts @@ -91,7 +91,7 @@ export default class ChdmanBin { } }); - proc.on('exit', (code) => { + proc.on('close', (code) => { const output = Buffer.concat(chunks).toString().trim(); if ((code !== null && code !== 0) || killed) { return reject(output); diff --git a/src/chdman/chdmanHelp.ts b/src/chdman/chdmanHelp.ts index 96bf113..5881536 100644 --- a/src/chdman/chdmanHelp.ts +++ b/src/chdman/chdmanHelp.ts @@ -5,12 +5,10 @@ export default { * Return info about a CHD file. */ async help(attempt = 1): Promise { - const MAX_ATTEMPTS = 3; - const output = await ChdmanBin.run(['help']); // Try to detect failures, and then retry them automatically - if (!output.trim() && attempt < MAX_ATTEMPTS) { + if (!output.trim() && attempt <= 3) { await new Promise((resolve) => { setTimeout(resolve, Math.random() * (2 ** (attempt - 1) * 20)); }); diff --git a/src/chdman/chdmanInfo.ts b/src/chdman/chdmanInfo.ts index c2f3417..e2edc56 100644 --- a/src/chdman/chdmanInfo.ts +++ b/src/chdman/chdmanInfo.ts @@ -49,9 +49,9 @@ export default { ]); // Try to detect failures, and then retry them automatically - if (!output.trim() && attempt <= 5) { + if (!output.trim() && attempt <= 3) { await new Promise((resolve) => { - setTimeout(resolve, Math.random() * (2 ** (attempt - 1) * 10)); + setTimeout(resolve, Math.random() * (2 ** (attempt - 1) * 20)); }); return this.info(options, attempt + 1); } @@ -121,7 +121,7 @@ export default { } satisfies CHDInfo; // Try to detect failures, and then retry them automatically - if (chdInfo.fileVersion === 0 && attempt <= 5) { + if (chdInfo.fileVersion === 0 && attempt <= 3) { await new Promise((resolve) => { setTimeout(resolve, Math.random() * (2 ** (attempt - 1) * 20)); });