Skip to content

Commit f5aa17d

Browse files
authored
ci: add network settings to post-mortem logs and improve timeout detections (#21361)
* info blockL: add load average details * log the proxy envs in the post mortems * remove iostat * better detection of time out
1 parent c4c81c0 commit f5aa17d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/functional_test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
system_profiler SPStorageDataType | sed -n '1,200p' || true
142142
143143
echo "=== Network ==="
144+
echo $HTTP_PROXY
144145
ifconfig
145146
networksetup -listallhardwareports || true
146147
scutil --get HostName || true
@@ -153,6 +154,7 @@ jobs:
153154
echo "=== Uptime and Load ==="
154155
uptime
155156
sysctl kern.boottime || true
157+
top -l 1 -n 0 | head -n 10 || true
156158
157159
echo "=== Security ==="
158160
spctl --status || true
@@ -208,6 +210,7 @@ jobs:
208210
df -h || true
209211
210212
echo "=== Network ==="
213+
echo $HTTP_PROXY
211214
ip addr show || true
212215
ip route || true
213216
ip -s link || true
@@ -219,6 +222,7 @@ jobs:
219222
echo "=== Uptime and Load ==="
220223
uptime || true
221224
who -b || true
225+
top -b -n1 | head -n 10 || true
222226
cat /proc/loadavg || true
223227
awk '{printf "Uptime (seconds): %s\n", $1}' /proc/uptime 2>/dev/null || true
224228
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
@@ -413,7 +417,7 @@ jobs:
413417
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
414418
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${{ matrix.name }} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
415419
# Check if the test step failed AND the log contains "timed out"
416-
if [[ "${{ steps.run_test.outcome }}" == "failure" && $(grep -c "timed out" ./report/testout.txt) -gt 0 ]]; then
420+
if [[ "${{ steps.run_test.outcome }}" == "failure" && $(grep -c "panic: test timed out" ./report/testout.txt) -gt 0 ]]; then
417421
# If it was a timeout, set your custom message
418422
RESULT_SHORT="⌛⌛⌛ Test Timed out ${TIME_ELAPSED} ⌛⌛⌛"
419423
else

test/integration/helpers_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,15 @@ func PostMortemLogs(t *testing.T, profile string, multinode ...bool) {
220220
}
221221

222222
t.Logf("-----------------------post-mortem--------------------------------")
223-
223+
t.Logf("======> post-mortem[%s]: network settings <======", t.Name())
224+
hostEnv := func(k string) string {
225+
if v := os.Getenv(k); v != "" {
226+
return v
227+
}
228+
return "<empty>"
229+
}
230+
t.Logf("HOST ENV snapshots: PROXY env: HTTP_PROXY=%q HTTPS_PROXY=%q NO_PROXY=%q",
231+
hostEnv("HTTP_PROXY"), hostEnv("HTTPS_PROXY"), hostEnv("NO_PROXY"))
224232
for _, n := range nodes {
225233
machine := profile
226234
if n != profile {

0 commit comments

Comments
 (0)