Core Rule Set tests: only the concurrency test runs with the race detector (closes #306) #307

Merged
clawbot merged 1 commits from issue-306-race-only-concurrent into next 2026-11-11 00:43:18 +01:00
Collaborator

Closes #306.

internal/coreruleset now runs only its concurrency tests under -race. Under -race, its other tests brought it near the 90-second limit when the host is busy.

Race pass (test-race): every package except internal/coreruleset as before, then internal/coreruleset with -run '^TestConcurrent', the prefix of the tests written to check concurrent inspection. Tests of the package run here: 1.

  • TestConcurrentRequestsKeepTheirOwnExclusions

Second pass (test-recorded): internal/coreruleset with the recorded tag and -skip '^TestConcurrent', so it runs every other test of the package, the recorded requests included. Tests run here: 101.

The package has 102 top-level test functions and no examples, fuzz tests or TestMain, so 1 + 101 covers it. No test, request or value is removed; the 90-second limit stays.

Tests whose subtests run in parallel only to save time, such as the password tests, run in the second pass, per the clarification of the definition of done at #306 (comment).

Things the diff does not show:

  • The race pass now runs two go test invocations in one step. The package list comes from go list ./... minus internal/coreruleset.
  • The name alone picks the pass: a new test named TestConcurrent... runs under -race, and any other name runs in the second pass.

Disclosure:

  • Deviation: the README's script/test entry is updated too, since it said the second pass runs only the recorded requests. That is outside "test files and the Dockerfile's test stages".

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/306. `internal/coreruleset` now runs only its concurrency tests under `-race`. Under `-race`, its other tests brought it near the 90-second limit when the host is busy. **Race pass** (`test-race`): every package except `internal/coreruleset` as before, then `internal/coreruleset` with `-run '^TestConcurrent'`, the prefix of the tests written to check concurrent inspection. Tests of the package run here: 1. - `TestConcurrentRequestsKeepTheirOwnExclusions` **Second pass** (`test-recorded`): `internal/coreruleset` with the `recorded` tag and `-skip '^TestConcurrent'`, so it runs every other test of the package, the recorded requests included. Tests run here: 101. The package has 102 top-level test functions and no examples, fuzz tests or `TestMain`, so 1 + 101 covers it. No test, request or value is removed; the 90-second limit stays. Tests whose subtests run in parallel only to save time, such as the password tests, run in the second pass, per the clarification of the definition of done at https://git.eeqj.de/sneak/smallwebwaf/issues/306#issuecomment-175750. Things the diff does not show: - The race pass now runs two `go test` invocations in one step. The package list comes from `go list ./...` minus `internal/coreruleset`. - The name alone picks the pass: a new test named `TestConcurrent...` runs under `-race`, and any other name runs in the second pass. Disclosure: - Deviation: the README's `script/test` entry is updated too, since it said the second pass runs only the recorded requests. That is outside "test files and the `Dockerfile`'s test stages". Model: opus-5-5
clawbot added the needs-review label 2026-11-10 23:49:12 +01:00
clawbot self-assigned this 2026-11-10 23:49:12 +01:00
Author
Collaborator

FAIL (needs-rework)

  1. Dockerfile, test-race stage: the race pass leaves out tests that inspect requests from several goroutines at once, which the definition of done in #306 puts in it. Each of these runs parallel subtests that send requests to different targets, each with its own exclusions, through one shared Core Rule Set at the same time. That is the pattern of the race in #254. Several reach it through wantPasswordFieldsPass.

    • TestDrupalPasswordPasses
    • TestDrupalPasswordFieldsPass
    • TestGiteaPasswordsPass
    • TestWordPressPasswordFieldsPass
    • TestMastodonPasswordsPass
    • TestMastodonPasswordConfirmationPasses
    • TestMediaWikiPasswordsPass
    • TestMediaWikiSignUpAndPasswordChangeFieldsPass
    • TestNextcloudPasswordFieldsPass
    • TestVaultwardenAdminTokenPasses

    The PR body's judgement call covers only the workers in findMisfiringPasswords, not these subtests. Acceptable: the race pass runs these tests and the second pass skips them. The PR body names each test and gives the new counts, in under about 250 words (it is 260 now). The other way out is a ruling on the issue that excludes them, cited in the PR body.

  2. The Dockerfile comment above test-race and the README's script/test entry are false. The comment says only TestConcurrentRequestsKeepTheirOwnExclusions inspects requests that way. The README says the race pass runs "only the one that inspects requests from several goroutines at once". Finding 1 shows otherwise, and the PR body says the password workers inspect at once too. Acceptable: after finding 1 is fixed, one short, true sentence in each says which Core Rule Set tests the race pass runs.

  3. Dockerfile: the exact test name appears four times: in -run, in -skip, and again in each -v rerun. The PR body says a rename silently leaves the race pass with no Core Rule Set test. Once finding 1 is fixed, those four copies become an eleven-name list. Acceptable: the race-pass tests share one name prefix, the way the recorded tests share TestOrdinary. Each stage then selects them with a single -run '^Prefix' or -skip '^Prefix'.

Judgement call: the README edit falls outside the issue's file scope but is not a finding, because the old sentence would have been false.

Model: opus-5-5

**FAIL** (`needs-rework`) 1. `Dockerfile`, `test-race` stage: the race pass leaves out tests that inspect requests from several goroutines at once, which the definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/306 puts in it. Each of these runs parallel subtests that send requests to different targets, each with its own exclusions, through one shared Core Rule Set at the same time. That is the pattern of the race in https://git.eeqj.de/sneak/smallwebwaf/issues/254. Several reach it through `wantPasswordFieldsPass`. - `TestDrupalPasswordPasses` - `TestDrupalPasswordFieldsPass` - `TestGiteaPasswordsPass` - `TestWordPressPasswordFieldsPass` - `TestMastodonPasswordsPass` - `TestMastodonPasswordConfirmationPasses` - `TestMediaWikiPasswordsPass` - `TestMediaWikiSignUpAndPasswordChangeFieldsPass` - `TestNextcloudPasswordFieldsPass` - `TestVaultwardenAdminTokenPasses` The PR body's judgement call covers only the workers in `findMisfiringPasswords`, not these subtests. Acceptable: the race pass runs these tests and the second pass skips them. The PR body names each test and gives the new counts, in under about 250 words (it is 260 now). The other way out is a ruling on the issue that excludes them, cited in the PR body. 2. The `Dockerfile` comment above `test-race` and the README's `script/test` entry are false. The comment says only `TestConcurrentRequestsKeepTheirOwnExclusions` inspects requests that way. The README says the race pass runs "only the one that inspects requests from several goroutines at once". Finding 1 shows otherwise, and the PR body says the password workers inspect at once too. Acceptable: after finding 1 is fixed, one short, true sentence in each says which Core Rule Set tests the race pass runs. 3. `Dockerfile`: the exact test name appears four times: in `-run`, in `-skip`, and again in each `-v` rerun. The PR body says a rename silently leaves the race pass with no Core Rule Set test. Once finding 1 is fixed, those four copies become an eleven-name list. Acceptable: the race-pass tests share one name prefix, the way the recorded tests share `TestOrdinary`. Each stage then selects them with a single `-run '^Prefix'` or `-skip '^Prefix'`. Judgement call: the README edit falls outside the issue's file scope but is not a finding, because the old sentence would have been false. Model: opus-5-5
Author
Collaborator

For the reworker. Finding 1 of #307 (comment) is settled by the clarification at the newest comment of #306: tests whose subtests run in parallel only to save time stay out of the race pass. Cite it in the PR body. Then, on top of b40a49d:

  1. Finding 3: every Core Rule Set test written to check concurrent inspection gets the name prefix TestConcurrent; each Dockerfile stage selects them with one -run '^TestConcurrent' or -skip '^TestConcurrent', in both the first run and the -v rerun.
  2. Finding 2: one short, true sentence in the Dockerfile comment above test-race and in the README's script/test entry says which Core Rule Set tests the race pass runs: those written to check concurrent inspection, named TestConcurrent....
  3. The PR body names the race-pass tests and the counts in each pass, in about 250 words.

Change nothing else. Rebase onto current next. Follow AGENTS.md: checks only through make targets. make fmt, then flock -w 1800 /srv/code/tmp/.gate-smallwebwaf.lock make check; a flock timeout also exits 1, so read the output. Push over SSH, label needs-review with tea, reply one line per point.

For the next reviewer: these three points against the diff from b40a49d, the clarified definition of done, and make check on the head. Fail only for one of these or for a bug the rework introduces.

Model: opus-5-5

**For the reworker.** Finding 1 of https://git.eeqj.de/sneak/smallwebwaf/pulls/307#issuecomment-175723 is settled by the clarification at the newest comment of https://git.eeqj.de/sneak/smallwebwaf/issues/306: tests whose subtests run in parallel only to save time stay out of the race pass. Cite it in the PR body. Then, on top of `b40a49d`: 1. Finding 3: every Core Rule Set test written to check concurrent inspection gets the name prefix `TestConcurrent`; each `Dockerfile` stage selects them with one `-run '^TestConcurrent'` or `-skip '^TestConcurrent'`, in both the first run and the `-v` rerun. 2. Finding 2: one short, true sentence in the `Dockerfile` comment above `test-race` and in the README's `script/test` entry says which Core Rule Set tests the race pass runs: those written to check concurrent inspection, named `TestConcurrent...`. 3. The PR body names the race-pass tests and the counts in each pass, in about 250 words. Change nothing else. Rebase onto current `next`. Follow `AGENTS.md`: checks only through `make` targets. `make fmt`, then `flock -w 1800 /srv/code/tmp/.gate-smallwebwaf.lock make check`; a `flock` timeout also exits 1, so read the output. Push over SSH, label `needs-review` with `tea`, reply one line per point. **For the next reviewer:** these three points against the diff from `b40a49d`, the clarified definition of done, and `make check` on the head. Fail only for one of these or for a bug the rework introduces. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-11 00:09:34 +01:00
clawbot added 1 commit 2026-11-11 00:13:43 +01:00
Of internal/coreruleset's tests, the race pass runs only those written to
check concurrent inspection, selected by the name prefix TestConcurrent.
Every other test of the package moves to the pass that runs the recorded
requests, without the race detector. Other packages run under -race as
before. The 90-second limit stays.

Model: opus-5-5
clawbot force-pushed issue-306-race-only-concurrent from b40a49d359 to 97c340e903 2026-11-11 00:13:43 +01:00 Compare
Author
Collaborator

Reworked as 97c340e, rebased onto current next.

  • Finding 1: the PR body cites the clarification at #306 (comment).
  • Point 1: nothing renamed, since the package's only test written to check concurrent inspection, TestConcurrentRequestsKeepTheirOwnExclusions, already has the prefix; test-race selects with -run '^TestConcurrent' and test-recorded with -skip '^TestConcurrent', in both runs.
  • Point 2: done in the Dockerfile comment above test-race and the README's script/test entry.
  • Point 3: done, in 235 words.

Model: opus-5-5

Reworked as `97c340e`, rebased onto current `next`. - Finding 1: the PR body cites the clarification at https://git.eeqj.de/sneak/smallwebwaf/issues/306#issuecomment-175750. - Point 1: nothing renamed, since the package's only test written to check concurrent inspection, `TestConcurrentRequestsKeepTheirOwnExclusions`, already has the prefix; `test-race` selects with `-run '^TestConcurrent'` and `test-recorded` with `-skip '^TestConcurrent'`, in both runs. - Point 2: done in the `Dockerfile` comment above `test-race` and the README's `script/test` entry. - Point 3: done, in 235 words. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-11 00:18:53 +01:00
Author
Collaborator

PASS: on current next, the race pass runs only TestConcurrentRequestsKeepTheirOwnExclusions of internal/coreruleset, the second pass runs the package's other 101 tests, and every other package still runs under -race, as the clarified definition of done in #306 requires.

Judgement call: the README edit falls outside the issue's file scope. It is not a finding, because without it the README would be false.

Model: opus-5-5

**PASS**: on current `next`, the race pass runs only `TestConcurrentRequestsKeepTheirOwnExclusions` of `internal/coreruleset`, the second pass runs the package's other 101 tests, and every other package still runs under `-race`, as the clarified definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/306 requires. Judgement call: the README edit falls outside the issue's file scope. It is not a finding, because without it the README would be false. Model: opus-5-5
clawbot merged commit 83f50dd11f into next 2026-11-11 00:43:18 +01:00
clawbot deleted branch issue-306-race-only-concurrent 2026-11-11 00:43:19 +01:00
Sign in to join this conversation.