From 83aa553eb36b6530c46253b19907e860ee754780 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index f0efbefda5..96fc30687f 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -164,6 +164,23 @@ jobs: run: pgrep antnode | wc -l if: always() + - name: confirm opened FDs + shell: bash + timeout-minutes: 1 + continue-on-error: true + 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