-
Notifications
You must be signed in to change notification settings - Fork 407
143 lines (137 loc) · 5.75 KB
/
Copy pathprofiling.yml
File metadata and controls
143 lines (137 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Profiling
on:
pull_request:
push:
branches: [master, mq-working-branch-master-*]
schedule:
- cron: 0 4 * * *
workflow_dispatch:
inputs:
latest-version:
description: "Node version to use"
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ inputs.latest-version }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }}
cancel-in-progress: true
env:
LATEST_VERSION: ${{ inputs.latest-version }}
jobs:
macos:
name: ${{ github.workflow }} / macos
runs-on: macos-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/latest
- uses: ./.github/actions/install
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- run: npm run test:otel-thread-ctx
- uses: ./.github/actions/coverage
with:
flags: profiling-macos
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}
ubuntu:
name: ${{ github.workflow }} / ubuntu
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node/oldest-maintenance-lts
- uses: ./.github/actions/install
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- uses: ./.github/actions/node/newest-maintenance-lts
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- uses: ./.github/actions/node/active-lts
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- uses: ./.github/actions/node/latest
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- run: npm run test:otel-thread-ctx
- uses: ./.github/actions/coverage
with:
flags: profiling-ubuntu
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}
windows:
name: ${{ github.workflow }} / windows
runs-on: windows-2022
permissions:
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/node
with:
version: 24.14.1 # TODO: remove pin when https://github.com/nodejs/node/issues/62991 is fixed
- uses: ./.github/actions/install
# Enable Windows Error Reporting LocalDumps for node.exe so __fastfail /
# RaiseFailFastException crashes (e.g. STATUS_STACK_BUFFER_OVERRUN /
# 0xC0000409) — which bypass V8 and process.report — still produce a
# minidump. See PROF-14469.
- name: Enable WER LocalDumps for node.exe
shell: pwsh
run: |
$dumpDir = Join-Path $env:RUNNER_TEMP 'windows-crash-dumps'
New-Item -ItemType Directory -Force -Path $dumpDir | Out-Null
$key = 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\node.exe'
New-Item -Path $key -Force | Out-Null
Set-ItemProperty -Path $key -Name DumpFolder -Type ExpandString -Value $dumpDir
# DumpType=0 means "use CustomDumpFlags". Flags chosen for diagnosing native-binding
# teardown crashes (PROF-14469) without including heap memory:
# 0x0001 MiniDumpWithDataSegs — module .data segments (V8/libc globals)
# 0x0004 MiniDumpWithHandleData — process handle table
# 0x0020 MiniDumpWithUnloadedModules — modules unloaded before the crash
# 0x1000 MiniDumpWithThreadInfo — per-thread CPU/start-address/affinity
Set-ItemProperty -Path $key -Name DumpType -Type DWord -Value 0
Set-ItemProperty -Path $key -Name CustomDumpFlags -Type DWord -Value 0x1025
Set-ItemProperty -Path $key -Name DumpCount -Type DWord -Value 20
"WER_DUMP_DIR=$dumpDir" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
# Defense-in-depth: blank known-sensitive env vars before tests so that
# if any of them ever do end up in the test process env (today they
# don't, but it's one workflow edit away), they cannot reach a published
# minidump artifact via module data segments or static state.
- name: Scrub sensitive env before tests
shell: pwsh
run: |
@(
'DD_API_KEY',
'DD_APP_KEY',
'DD_APPLICATION_KEY',
'GITHUB_TOKEN',
'NODE_AUTH_TOKEN',
'NPM_TOKEN'
) | ForEach-Object { "$_=" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 }
- run: npm run test:profiler:ci
- run: npm run test:integration:profiler:coverage
- run: npm run test:otel-thread-ctx
- uses: ./.github/actions/node-crash-report
if: failure()
# Upload any WER minidumps that landed during this job, even on
# mocha-retry-recovered success — those are exactly the flake signatures
# we want to inspect.
- name: Upload Windows crash dumps
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: windows-crash-dumps-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ env.WER_DUMP_DIR }}/*.dmp
if-no-files-found: ignore
retention-days: 14
- uses: ./.github/actions/coverage
with:
flags: profiling-windows
- uses: ./.github/actions/upload-junit-artifacts
if: "!cancelled()"
with:
id: ${{ github.job }}