Skip to content

fix(fuzz): disable DNS resolution during fuzz runs#90

Merged
cyyever merged 1 commit intomainfrom
fixes_v4.1.1
Mar 15, 2026
Merged

fix(fuzz): disable DNS resolution during fuzz runs#90
cyyever merged 1 commit intomainfrom
fixes_v4.1.1

Conversation

@cyyever
Copy link
Collaborator

@cyyever cyyever commented Mar 15, 2026

Summary

  • Auto-detect -test.fuzz= flag via os.Args and disable DNS resolution during fuzz runs
  • Prevents 2s-per-lookup timeouts on random fuzzed hostnames that accumulate into context deadline exceeded CI failures (observed in FuzzCommandRegexBypass)
  • DNS-dependent unit tests gracefully skip in fuzz mode via needDNS flag

Test plan

  • go test ./internal/rules/ -run TestResolves — DNS tests pass normally
  • go test ./internal/rules/ -fuzz=FuzzCommandRegexBypass -fuzztime=15s -short — completes without timeout
  • All pre-commit hooks pass (gofmt, golangci-lint, nilaway, go test, etc.)

…outs

Fuzz inputs trigger real DNS lookups on random hostnames (2s timeout each),
accumulating into context deadline exceeded failures during 12s fuzz runs.
Auto-detect -test.fuzz flag via os.Args and skip DNS; DNS-dependent unit
tests gracefully skip in fuzz mode.
@cyyever cyyever merged commit 5652554 into main Mar 15, 2026
29 of 30 checks passed
@cyyever cyyever deleted the fixes_v4.1.1 branch March 15, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant