diff --git a/.github/workflows/test-bpftrace.yml b/.github/workflows/test-bpftrace.yml index fd6c3873..6a28e413 100644 --- a/.github/workflows/test-bpftrace.yml +++ b/.github/workflows/test-bpftrace.yml @@ -49,12 +49,22 @@ jobs: test -n "$hello_address" || (echo "Error: demangled hello function symbol not found" && exit 1) hello_symbol=$(nm target/debug/helloworld | awk -v address="$hello_address" '$1 == address && $2 ~ /^[tT]$/ && !matched { found = $3; matched = 1 } END { if (matched) print found }') test -n "$hello_symbol" || (echo "Error: raw hello function symbol not found" && exit 1) - sudo timeout 3 bpftrace -e "uprobe:target/debug/helloworld:${hello_symbol} { printf(\"traced\\n\"); exit(); }" -c "./target/debug/helloworld 1" > /tmp/bpftrace_output.txt 2>&1 || true + # Give bpftrace room to start: attaching a uprobe plus spawning the + # -c command can take longer than 3s on a loaded runner, and when the + # timeout fires mid-startup the redirect file stays empty, which reads + # as "failed to attach" rather than "took too long". + sudo timeout 10 bpftrace -e "uprobe:target/debug/helloworld:${hello_symbol} { printf(\"traced\\n\"); exit(); }" -c "./target/debug/helloworld 1" > /tmp/bpftrace_output.txt 2>&1 || true # Check if bpftrace successfully attached and traced the function - if grep -q "traced" /tmp/bpftrace_output.txt && grep -q "Attaching 1 probe" /tmp/bpftrace_output.txt; then + # bpftrace <= 0.19 prints "Attaching N probes", 0.20+ prints + # "Attached N probes"; accept either so the assertion tracks the probe + # being installed rather than the wording of one release. + if grep -q "traced" /tmp/bpftrace_output.txt && grep -Eq "Attach(ing|ed) 1 probe" /tmp/bpftrace_output.txt; then echo "✓ bpftrace successfully attached to hello function" else echo "Error: bpftrace failed to attach or trace the hello function" + if [ ! -s /tmp/bpftrace_output.txt ]; then + echo " (output file is empty: bpftrace likely did not finish starting before the timeout)" + fi cat /tmp/bpftrace_output.txt exit 1 fi diff --git a/.github/workflows/test-eunomia.yaml b/.github/workflows/test-eunomia.yaml index b82c8254..090ebbec 100644 --- a/.github/workflows/test-eunomia.yaml +++ b/.github/workflows/test-eunomia.yaml @@ -13,7 +13,8 @@ permissions: jobs: build: - runs-on: ubuntu-latest + # LLVM 14 is not available on ubuntu-26.04 (the current ubuntu-latest). + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v7 with: