TestBanNotes can fail when the test process is held up past the lookup timeout #119

Open
opened 2026-10-08 06:51:54 +02:00 by clawbot · 1 comment
Collaborator

script/cibuild on next at 54779f0 failed once in internal/proxy, TestBanNotes, and passed when the same tests ran again moments later: the ban's notes lacked the AS number, AS name and country. The test sets SWWAF_DENIED_COUNTRIES, so its first request waits for the GeoJS stand-in's answer, but only up to SWWAF_LOOKUP_TIMEOUT on the real clock; when the test process is held up past it, the client counts as unknown, the ban is made before the answer arrives, and the notes are compared before the answer is added to them. A test that can fail on a hold-up alone can turn next red with no change behind it. One PR to next.

What to do

  • Make TestBanNotes unable to fail on a hold-up of the test process: for example wait until the answer has reached the ban's notes before comparing, or give the test a lookup timeout no hold-up reaches, without weakening what it checks.
  • Find every other test in the repo that depends on a lookup answering within SWWAF_LOOKUP_TIMEOUT on the real clock (the tests added with #95 and later units that set a country list, SWWAF_ADD_LOOKUP_HEADERS or a percentage for AS numbers or countries) and fix each the same way; the PR body lists any that needed no change, one line each on why.

Definition of done

  • Each changed test still fails with its rule broken (locally, never pushed).
  • make test passes ten runs in a row while other gates run on the host.
  • make check green; one PR to next, passed by a reviewer who did not write it.

Model: opus-5-5

`script/cibuild` on `next` at `54779f0` failed once in `internal/proxy`, `TestBanNotes`, and passed when the same tests ran again moments later: the ban's notes lacked the AS number, AS name and country. The test sets `SWWAF_DENIED_COUNTRIES`, so its first request waits for the GeoJS stand-in's answer, but only up to `SWWAF_LOOKUP_TIMEOUT` on the real clock; when the test process is held up past it, the client counts as unknown, the ban is made before the answer arrives, and the notes are compared before the answer is added to them. A test that can fail on a hold-up alone can turn `next` red with no change behind it. One PR to `next`. ## What to do - Make `TestBanNotes` unable to fail on a hold-up of the test process: for example wait until the answer has reached the ban's notes before comparing, or give the test a lookup timeout no hold-up reaches, without weakening what it checks. - Find every other test in the repo that depends on a lookup answering within `SWWAF_LOOKUP_TIMEOUT` on the real clock (the tests added with https://git.eeqj.de/sneak/smallwebwaf/issues/95 and later units that set a country list, `SWWAF_ADD_LOOKUP_HEADERS` or a percentage for AS numbers or countries) and fix each the same way; the PR body lists any that needed no change, one line each on why. ## Definition of done - Each changed test still fails with its rule broken (locally, never pushed). - `make test` passes ten runs in a row while other gates run on the host. - `make check` green; one PR to `next`, passed by a reviewer who did not write it. Model: opus-5-5
clawbot added the critical label 2026-10-08 06:51:54 +02:00
clawbot self-assigned this 2026-10-08 06:51:54 +02:00
Author
Collaborator

Pull request: #120

Model: opus-5-5

Pull request: https://git.eeqj.de/sneak/smallwebwaf/pulls/120 Model: opus-5-5
Sign in to join this conversation.