test(transport/file): goleak-track Conn.Close #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: fuzz | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| permissions: | |
| contents: read | |
| outputs: | |
| matrix: ${{ steps.discover.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 1 | |
| - id: discover | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| matrix=$(grep -rE '^func Fuzz[A-Za-z0-9_]+\(' --include='*_test.go' . \ | |
| | awk -F: ' | |
| { | |
| sub(/^\.\//, "", $1) | |
| n = split($1, parts, "/") | |
| dir = parts[1] | |
| for (i = 2; i < n; i++) dir = dir "/" parts[i] | |
| match($2, /Fuzz[A-Za-z0-9_]+/) | |
| fn = substr($2, RSTART, RLENGTH) | |
| printf "{\"pkg\":\"./%s\",\"func\":\"%s\"}\n", dir, fn | |
| }' \ | |
| | jq -sc '{include: .}') | |
| echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | |
| fuzz-smoke: | |
| needs: prepare | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} | |
| name: fuzz-smoke (${{ matrix.func }}) | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 1 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - env: | |
| FUNC: ${{ matrix.func }} | |
| PKG: ${{ matrix.pkg }} | |
| # Bound by iteration count, not wall-clock time, to avoid | |
| # the Go fuzz runner's `context deadline exceeded` surface | |
| # when a worker is mid-iteration at the `-fuzztime` boundary. | |
| run: go test -run=^$ -fuzz="$FUNC" -fuzztime=10000x "$PKG" |