ci(fuzz): give generated targets a shorter fuzz time so the workflow fits its timeout
- commit
- 1bfe7474d8a7712e43daf371a73140f9a66e116a
- author
- brice · · 2026-10-22 10:40 UTC
- parent
- 32dc121
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
3 files · +10 -6
M .github/workflows/fuzz.yml +2 -2
| @@ -8,10 +8,10 @@ permissions: | |||
| 8 | 8 | jobs: | |
| 9 | 9 | fuzz: | |
| 10 | 10 | runs-on: ubuntu-latest | |
| 11 | - | timeout-minutes: 60 | |
| 11 | + | timeout-minutes: 45 | |
| 12 | 12 | steps: | |
| 13 | 13 | - uses: actions/checkout@v4 | |
| 14 | 14 | - uses: actions/setup-go@v5 | |
| 15 | 15 | with: | |
| 16 | 16 | go-version-file: go.mod | |
| 17 | - | - run: make fuzz FUZZTIME=60s | |
| 17 | + | - run: make fuzz FUZZTIME=60s GENFUZZTIME=20s | |
| @@ -8,10 +8,10 @@ permissions: | |||||
| 8 | jobs: | 8 | jobs: | ||
| 9 | fuzz: | 9 | fuzz: | ||
| 10 | runs-on: ubuntu-latest | 10 | runs-on: ubuntu-latest | ||
| 11 | - | timeout-minutes: 60 | 11 | + | timeout-minutes: 45 |
| 12 | steps: | 12 | steps: | ||
| 13 | - uses: actions/checkout@v4 | 13 | - uses: actions/checkout@v4 | ||
| 14 | - uses: actions/setup-go@v5 | 14 | - uses: actions/setup-go@v5 | ||
| 15 | with: | 15 | with: | ||
| 16 | go-version-file: go.mod | 16 | go-version-file: go.mod | ||
| 17 | - | - run: make fuzz FUZZTIME=60s | 17 | + | - run: make fuzz FUZZTIME=60s GENFUZZTIME=20s |
M Makefile +7 -3
| @@ -1,6 +1,7 @@ | |||
| 1 | 1 | export CGO_ENABLED := 0 | |
| 2 | 2 | STATICCHECK ?= staticcheck | |
| 3 | 3 | FUZZTIME ?= 60s | |
| 4 | + | GENFUZZTIME ?= 10s | |
| 4 | 5 | ||
| 5 | 6 | .PHONY: gen gen-check test race alloc poison bench fuzz xserver staticcheck vet check | |
| 6 | 7 | ||
| @@ -19,11 +20,14 @@ poison: | |||
| 19 | 20 | go test -tags xturbo_poison ./... | |
| 20 | 21 | bench: | |
| 21 | 22 | go test -bench . -benchmem ./... | |
| 23 | + | # Root targets (dispatch, event decode, reply ring) get FUZZTIME; generated | |
| 24 | + | # packages and the generator get GENFUZZTIME. | |
| 22 | 25 | fuzz: | |
| 23 | - | @set -e; for pkg in $$(go list ./...); do \ | |
| 26 | + | @set -e; root=$$(go list .); for pkg in $$(go list ./...); do \ | |
| 27 | + | time=$(GENFUZZTIME); [ "$$pkg" = "$$root" ] && time=$(FUZZTIME); \ | |
| 24 | 28 | for t in $$(go test -list 'Fuzz.*' $$pkg | grep '^Fuzz'); do \ | |
| 25 | - | echo "== $$pkg $$t ($(FUZZTIME))"; \ | |
| 26 | - | go test -run '^$$' -fuzz "^$$t$$" -fuzztime $(FUZZTIME) $$pkg; \ | |
| 29 | + | echo "== $$pkg $$t ($$time)"; \ | |
| 30 | + | go test -run '^$$' -fuzz "^$$t$$" -fuzztime $$time $$pkg; \ | |
| 27 | 31 | done; \ | |
| 28 | 32 | done | |
| 29 | 33 | xserver: | |
| @@ -1,6 +1,7 @@ | |||||
| 1 | export CGO_ENABLED := 0 | 1 | export CGO_ENABLED := 0 | ||
| 2 | STATICCHECK ?= staticcheck | 2 | STATICCHECK ?= staticcheck | ||
| 3 | FUZZTIME ?= 60s | 3 | FUZZTIME ?= 60s | ||
| 4 | + | GENFUZZTIME ?= 10s | |||
| 4 | 5 | ||||
| 5 | .PHONY: gen gen-check test race alloc poison bench fuzz xserver staticcheck vet check | 6 | .PHONY: gen gen-check test race alloc poison bench fuzz xserver staticcheck vet check | ||
| 6 | 7 | ||||
| @@ -19,11 +20,14 @@ poison: | |||||
| 19 | go test -tags xturbo_poison ./... | 20 | go test -tags xturbo_poison ./... | ||
| 20 | bench: | 21 | bench: | ||
| 21 | go test -bench . -benchmem ./... | 22 | go test -bench . -benchmem ./... | ||
| 23 | + | # Root targets (dispatch, event decode, reply ring) get FUZZTIME; generated | |||
| 24 | + | # packages and the generator get GENFUZZTIME. | |||
| 22 | fuzz: | 25 | fuzz: | ||
| 23 | - | @set -e; for pkg in $$(go list ./...); do \ | 26 | + | @set -e; root=$$(go list .); for pkg in $$(go list ./...); do \ |
| 27 | + | time=$(GENFUZZTIME); [ "$$pkg" = "$$root" ] && time=$(FUZZTIME); \ | |||
| 24 | for t in $$(go test -list 'Fuzz.*' $$pkg | grep '^Fuzz'); do \ | 28 | for t in $$(go test -list 'Fuzz.*' $$pkg | grep '^Fuzz'); do \ | ||
| 25 | - | echo "== $$pkg $$t ($(FUZZTIME))"; \ | 29 | + | echo "== $$pkg $$t ($$time)"; \ |
| 26 | - | go test -run '^$$' -fuzz "^$$t$$" -fuzztime $(FUZZTIME) $$pkg; \ | 30 | + | go test -run '^$$' -fuzz "^$$t$$" -fuzztime $$time $$pkg; \ |
| 27 | done; \ | 31 | done; \ | ||
| 28 | done | 32 | done | ||
| 29 | xserver: | 33 | xserver: | ||
M README.md +1 -1
| @@ -166,7 +166,7 @@ go run ./cmd/xtsync # refresh spec/ from upstream and update the manifest | |||
| 166 | 166 | ```sh | |
| 167 | 167 | make check # vet, staticcheck, tests, race, allocation, poison, gen-check | |
| 168 | 168 | make xserver # tests against a real Xvfb (needs xvfb and xtrace) | |
| 169 | - | make fuzz # every Fuzz target for FUZZTIME each (default 60s) | |
| 169 | + | make fuzz # root targets for FUZZTIME (60s), generated ones for GENFUZZTIME (10s) | |
| 170 | 170 | make bench # benchmarks | |
| 171 | 171 | ``` | |
| 172 | 172 | ||
| @@ -166,7 +166,7 @@ go run ./cmd/xtsync # refresh spec/ from upstream and update the manifest | |||||
| 166 | ```sh | 166 | ```sh | ||
| 167 | make check # vet, staticcheck, tests, race, allocation, poison, gen-check | 167 | make check # vet, staticcheck, tests, race, allocation, poison, gen-check | ||
| 168 | make xserver # tests against a real Xvfb (needs xvfb and xtrace) | 168 | make xserver # tests against a real Xvfb (needs xvfb and xtrace) | ||
| 169 | - | make fuzz # every Fuzz target for FUZZTIME each (default 60s) | 169 | + | make fuzz # root targets for FUZZTIME (60s), generated ones for GENFUZZTIME (10s) |
| 170 | make bench # benchmarks | 170 | make bench # benchmarks | ||
| 171 | ``` | 171 | ``` | ||
| 172 | 172 | ||||