Repository navigation
141 lines (135 loc) · 5.17 KB
/
Copy pathgrpc-ruby-hang.yml
File metadata and controls
141 lines (135 loc) · 5.17 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
# Hunt for the gRPC Ruby server shutdown hang on real arm64 hardware.
# See scripts/grpc_ruby_hang.sh. Started by hand only (Actions tab, "Run
# workflow"), so nothing runs on push and nothing runs from pull requests.
#
# This runs the specs as gRPC's arm64 Ruby CI does (tools/internal_ci/linux/
# arm64/grpc_basictests_ruby.cfg and tools/run_tests/run_tests.py): a dbg
# and an opt build, each spec file in its own process, 16 at once, with
# GRPC_VERBOSITY=DEBUG. CI's list leaves out end2end/; three of its specs
# are left out here too, since they need gRPC's lib/ tree or protoc.
#
# The grpc gem is built from source, so gdb backtraces have symbols; the
# build is cached per version and config, so only the first run of a
# version pays for it.
name: gRPC Ruby hang
on:
workflow_dispatch:
inputs:
version:
description: grpc gem version (the hang should be in 1.80.0 and earlier)
default: "1.80.0"
rounds:
description: Times each copy runs every spec
default: "40"
copies:
description: Copies run in parallel on each runner
default: "16"
specs:
description: Spec files, or "ci" for CI's list
default: ci
permissions:
contents: read
env:
RUBY_VERSION: "3.3"
CI_SPECS: >-
spec/client_server_spec.rb spec/errors_spec.rb
spec/pb/health/checker_spec.rb spec/pb/duplicate/codegen_spec.rb
spec/server_spec.rb spec/error_sanity_spec.rb spec/channel_spec.rb
spec/user_agent_spec.rb spec/call_credentials_spec.rb
spec/channel_credentials_spec.rb spec/channel_connection_spec.rb
spec/compression_options_spec.rb spec/time_consts_spec.rb
spec/server_credentials_spec.rb spec/generic/server_interceptors_spec.rb
spec/generic/rpc_server_pool_spec.rb spec/generic/client_stub_spec.rb
spec/generic/active_call_spec.rb spec/generic/rpc_server_spec.rb
spec/generic/service_spec.rb spec/generic/client_interceptors_spec.rb
spec/generic/rpc_desc_spec.rb spec/generic/interceptor_registry_spec.rb
spec/debug_message_spec.rb spec/logconfig_spec.rb spec/call_spec.rb
spec/client_auth_spec.rb
jobs:
build:
runs-on: ubuntu-24.04-arm
timeout-minutes: 120
strategy:
matrix:
config: [dbg, opt]
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- id: cache
uses: actions/cache@v4
with:
path: ~/gems
key: grpc-ruby-hang-gems-${{ inputs.version }}-${{ matrix.config }}-ruby${{ env.RUBY_VERSION }}-arm64-v1
- name: Build grpc from source, keeping debug symbols
if: steps.cache.outputs.cache-hit != 'true'
run: |
export GEM_HOME=~/gems GEM_PATH=~/gems
# Install the precompiled gem for its dependencies, then replace it
# with a source build.
gem install --no-document grpc -v '${{ inputs.version }}'
gem uninstall grpc --all --ignore-dependencies --executables
dbg=$(mktemp -d)
GRPC_CONFIG=${{ matrix.config }} GRPC_RUBY_DEBUG_SYMBOLS_OUTPUT_DIR=$dbg \
gem install --no-document --platform ruby --ignore-dependencies \
grpc -v '${{ inputs.version }}'
gem install --no-document rspec logging simplecov
so=$(find ~/gems/gems/grpc-'${{ inputs.version }}' -name grpc_c.so)
# An opt build strips grpc_c.so after saving its debug info; link
# the two again so gdb finds the symbols.
if ls "$dbg"/*.dbg >/dev/null 2>&1; then
cp "$dbg"/*.dbg "$(dirname "$so")/"
objcopy --add-gnu-debuglink="$(ls "$(dirname "$so")"/*.dbg)" "$so"
fi
file "$so"
hunt:
needs: build
runs-on: ubuntu-24.04-arm
timeout-minutes: 300
strategy:
fail-fast: false
matrix:
config: [dbg, opt]
shard: [1, 2]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: scripts
- uses: actions/checkout@v4
with:
repository: grpc/grpc
ref: v${{ inputs.version }}
path: grpc
sparse-checkout: |
src/ruby/spec
src/ruby/pb
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/cache/restore@v4
with:
path: ~/gems
key: grpc-ruby-hang-gems-${{ inputs.version }}-${{ matrix.config }}-ruby${{ env.RUBY_VERSION }}-arm64-v1
fail-on-cache-miss: true
- name: Machine
run: |
uname -a
lscpu
sudo apt-get install -y gdb >/dev/null
- name: Run the specs until one hangs
env:
GEM_HOME: /home/runner/gems
GEM_PATH: /home/runner/gems
GRPC_VERBOSITY: DEBUG
SPECS: ${{ inputs.specs }}
run: |
[ "$SPECS" = ci ] && SPECS=$CI_SPECS
# shellcheck disable=SC2086
scripts/grpc_ruby_hang.sh grpc/src/ruby '${{ inputs.version }}' \
'${{ inputs.rounds }}' '${{ inputs.copies }}' results 120 $SPECS
- if: always()
uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.config }}-${{ matrix.shard }}
path: results
if-no-files-found: ignore