reputation: run the DNSBL resolver test in parallel (closes #406) #409

Merged
clawbot merged 1 commits from issue-406-parallel-tests into next 2026-11-17 06:57:45 +01:00
Collaborator

closes #406

TestQueriesGoToTheResolverSWWDNSBLResolverNames, one of the issue's six, now calls t.Parallel(). It queries a UDP stand-in outside any synctest bubble. Go starts a parallel test only after every test that is not parallel has ended, so it cannot overlap the bubbled DNSBL tests. No other parallel test of the reputation package queries a resolver. The comment at the top of internal/reputation/dnsbl_test.go says so.

The other five stay one at a time. So do ten DNSBL tests in synctest bubbles that the issue's scan missed. Each already gives its reason in a comment:

  • the two in internal/config/viper_test.go set environment variables, which Go refuses in a parallel test;
  • TestCorazaWritesNoFile sets TMPDIR for the whole process;
  • the inspection-time test compares processor time with reference work, which parallel tests would disturb;
  • TestASwitchNotPassedOnClosesTheAppsConnection would have a leaked connection closed by garbage collection that other tests start;
  • the bubbled DNSBL tests share Go's resolver, which fails when two bubbles query at once.

Every subtest inside a parallel test already calls t.Parallel(). The only subtests that do not are inside the inspection-time test and a bubbled DNSBL test, both one at a time.

Judgement call: I left the existing reason comments as they are. Each sits at its test or points to the comment at the top of its file.

Model: opus-5-5

closes https://git.eeqj.de/sneak/smallwebwaf/issues/406 `TestQueriesGoToTheResolverSWWDNSBLResolverNames`, one of the issue's six, now calls `t.Parallel()`. It queries a UDP stand-in outside any synctest bubble. Go starts a parallel test only after every test that is not parallel has ended, so it cannot overlap the bubbled DNSBL tests. No other parallel test of the `reputation` package queries a resolver. The comment at the top of `internal/reputation/dnsbl_test.go` says so. The other five stay one at a time. So do ten DNSBL tests in synctest bubbles that the issue's scan missed. Each already gives its reason in a comment: - the two in `internal/config/viper_test.go` set environment variables, which Go refuses in a parallel test; - `TestCorazaWritesNoFile` sets `TMPDIR` for the whole process; - the inspection-time test compares processor time with reference work, which parallel tests would disturb; - `TestASwitchNotPassedOnClosesTheAppsConnection` would have a leaked connection closed by garbage collection that other tests start; - the bubbled DNSBL tests share Go's resolver, which fails when two bubbles query at once. Every subtest inside a parallel test already calls `t.Parallel()`. The only subtests that do not are inside the inspection-time test and a bubbled DNSBL test, both one at a time. Judgement call: I left the existing reason comments as they are. Each sits at its test or points to the comment at the top of its file. Model: opus-5-5
clawbot added 1 commit 2026-11-17 06:32:22 +01:00
TestQueriesGoToTheResolverSWWDNSBLResolverNames queries a real UDP
stand-in outside any synctest bubble. A parallel test starts only once
every test that is not parallel has ended, so it can no longer overlap
the bubbled DNSBL tests, and no other parallel test of the package
queries a resolver.

The other tests that run one at a time stay so, each for the reason its
comment gives: environment variables, TMPDIR, timing, Go's resolver in
synctest bubbles, and garbage collection hiding a leaked connection.
Every subtest inside a parallel test already calls t.Parallel().

Model: opus-5-5
clawbot self-assigned this 2026-11-17 06:32:24 +01:00
clawbot added the needs-review label 2026-11-17 06:32:25 +01:00
Author
Collaborator

Verdict: PASS
Head: c125375ac7

The resolver test now runs in parallel without overlapping the bubbled DNSBL tests, and every test that stays one at a time has a valid reason in a comment, which meets the definition of done of #406.

Model: opus-5-5

Verdict: PASS Head: c125375ac7aab3b007ecbd6204109788ef3a8d89 The resolver test now runs in parallel without overlapping the bubbled DNSBL tests, and every test that stays one at a time has a valid reason in a comment, which meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/406. Model: opus-5-5
clawbot merged commit c0d9d5787e into next 2026-11-17 06:57:45 +01:00
Sign in to join this conversation.