Skip to content

Commit a5a9178

Browse files
committed
Debugging signals
Signed-off-by: Daniel González Lopes <[email protected]>
1 parent dbbec23 commit a5a9178

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.github/workflows/test.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
jobs:
66
protocol:
77
runs-on: ubuntu-latest
8-
env:
9-
K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }}
10-
K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }}
8+
# env:
9+
# K6_CLOUD_TOKEN: ${{ secrets.K6_CLOUD_TOKEN }}
10+
# K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }}
1111
steps:
1212
- uses: actions/checkout@v4
1313
- name: Setup Grafana k6
@@ -19,4 +19,5 @@ jobs:
1919
with:
2020
path: |
2121
./dev/protocol*.js
22-
flags: --vus 10 --duration 5m
22+
flags: --vus 10 --duration 5m
23+
parallel: true

dist/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -30008,6 +30008,14 @@ async function run() {
3000830008
}
3000930009
}
3001030010
exports.run = run;
30011+
process.on('SIGINT', () => {
30012+
console.log('🚨 Caught SIGINT. Exiting...');
30013+
process.exit(1);
30014+
});
30015+
process.on('SIGTERM', () => {
30016+
console.log('🚨 Caught SIGTERM. Exiting...');
30017+
process.exit(1);
30018+
});
3001130019
async function isCloudIntegrationEnabled() {
3001230020
if (process.env.K6_CLOUD_TOKEN === undefined || process.env.K6_CLOUD_TOKEN === '') {
3001330021
return false;

src/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ export async function run(): Promise<void> {
115115
}
116116
}
117117

118+
process.on('SIGINT', () => {
119+
console.log('🚨 Caught SIGINT. Exiting...');
120+
process.exit(1);
121+
});
122+
123+
process.on('SIGTERM', () => {
124+
console.log('🚨 Caught SIGTERM. Exiting...');
125+
process.exit(1);
126+
})
127+
118128
async function isCloudIntegrationEnabled(): Promise<boolean> {
119129
if (process.env.K6_CLOUD_TOKEN === undefined || process.env.K6_CLOUD_TOKEN === '') {
120130
return false

0 commit comments

Comments
 (0)