From 146651d49fb16c2f1495ffd4cab1da89f76c40ca Mon Sep 17 00:00:00 2001 From: qima Date: Tue, 14 Jan 2025 22:57:06 +0800 Subject: [PATCH] test(CI): confirm not open too many FDs --- .github/workflows/memcheck.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index f0efbefda5..89350fc49f 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -164,6 +164,22 @@ jobs: run: pgrep antnode | wc -l if: always() + - name: confirm opened FDs + shell: bash + timeout-minutes: 1 + run: | + fd_cap="30" + pids=$(pgrep antnode) + for pid in $pids; do + fd_count=$(ls /proc/$pid/fd | wc -l) + echo "Process $pid - File Descriptors: $fd_count" + if (( $(echo "$fd_count > $fd_cap" | bc -l) )); then + echo "Process $pid holding FD exceeded threshold: $fd_cap" + exit 1 + fi + done + if: always() + - name: Stop the local network and upload logs if: always() uses: maidsafe/ant-local-testnet-action@main