Skip to content

Commit

Permalink
chore: ??
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Dec 10, 2024
1 parent 7da299a commit bc7c0be
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ jobs:
- name: Tests
uses: nick-fields/retry@v3
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
env:
NODE_OPTIONS: -r ${{ github.workspace }}/kill-instrumentation.cjs
with:
timeout_minutes: 30
max_attempts: 3
Expand Down Expand Up @@ -221,6 +223,7 @@ jobs:
# split tests across multiple machines
CI_NODE_INDEX: ${{ matrix.machine }}
CI_NODE_TOTAL: 4
NODE_OPTIONS: -r ${{ github.workspace }}/kill-instrumentation.cjs
with:
timeout_minutes: 30
max_attempts: 3
Expand Down
24 changes: 24 additions & 0 deletions kill-instrumentation.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const childProcess = require('child_process')

const origSpawn = childProcess.spawn
childProcess.spawn = (...args1) => {
const process = origSpawn.apply(childProcess, args1)

const origKill = process.kill
process.kill = (...args2) => {
const stack = new Error('kill stack 2').stack
try {
return origKill.apply(process, args2)
} catch (error) {
console.log('Error in kill', stack)
throw error
}
}

return process
}

process.on('unhandledRejection', (reason, promise) => {
console.log('unhandledRejection logs', reason, promise)
})
4 changes: 2 additions & 2 deletions patches/execa+5.1.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index 287a142..bf71811 100644
};

const setKillTimeout = (kill, signal, options, killResult) => {
+ const stack = new Error('kill stack').stack;
+ const stack = new Error('kill stack 1').stack;
if (!shouldForceKill(signal, options, killResult)) {
return;
}
Expand All @@ -17,7 +17,7 @@ index 287a142..bf71811 100644
+ try {
+ kill('SIGKILL');
+ } catch (error) {
+ console.log('Error in kill timeout', error);
+ console.log('Error in kill timeout', stack);
+ throw e
+ }
}, timeout);
Expand Down

0 comments on commit bc7c0be

Please sign in to comment.