Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/stress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Stress Test

on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
stress:
runs-on: self-hosted-linux-amd64-noble-large
steps:
- uses: actions/checkout@v4
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Install stress
run: go install github.com/hpidcock/stress@latest

- name: Run stress tests
run: |
mkdir -p stress-failures
failed=0
p=$(( $(nproc) * 4 ))
passed_pkgs=()
failed_pkgs=()
compile_failed_pkgs=()
for pkg in $(go list ./...); do
echo "==> $pkg"
if ! GOEXPERIMENT=goroutineleakprofile \
go test -race -o pkg.test -c "$pkg"; then
echo "COMPILE FAILED: $pkg"
compile_failed_pkgs+=("$pkg")
failed=1
continue
fi
pkg_slug=$(echo "$pkg" | tr '/' '_')
if ! stress -fast \
-p "$p" \
-duration 5m \
-timeout 3m \
-o "stress-failures/${pkg_slug}-" \
./pkg.test; then
echo "STRESS FAILED: $pkg"
failed_pkgs+=("$pkg")
failed=1
else
passed_pkgs+=("$pkg")
fi
done

{
if [ $failed -eq 0 ]; then
echo "## Stress Tests Passed"
else
echo "## Stress Tests Failed"
fi
echo ""
echo "| Package | Result |"
echo "| ------- | ------ |"
for pkg in "${compile_failed_pkgs[@]}"; do
echo "| \`$pkg\` | Compile Failed |"
done
for pkg in "${failed_pkgs[@]}"; do
echo "| \`$pkg\` | Failed |"
done
for pkg in "${passed_pkgs[@]}"; do
echo "| \`$pkg\` | Passed |"
done
if [ ${#compile_failed_pkgs[@]} -gt 0 ] \
|| [ ${#failed_pkgs[@]} -gt 0 ]; then
echo ""
echo "## Failure Details"
for pkg in "${compile_failed_pkgs[@]}"; do
echo ""
echo "<details>"
echo "<summary><code>$pkg</code> — compile failed</summary>"
echo "</details>"
done
for pkg in "${failed_pkgs[@]}"; do
pkg_slug=$(echo "$pkg" | tr '/' '_')
echo ""
echo "<details>"
echo "<summary><code>$pkg</code></summary>"
echo ""
for f in "stress-failures/${pkg_slug}-"*; do
[ -f "$f" ] || continue
echo "<pre>"
cat "$f"
echo "</pre>"
echo ""
done
echo "</details>"
done
fi
} >> "$GITHUB_STEP_SUMMARY"

exit $failed

- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: stress-failures
path: stress-failures/
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Loading