Tests: make the six tests that still go one at a time parallel where they can be #406
Notifications
Due Date
No due date set.
Depends on
Reference: sneak/smallwebwaf#406
Reference in new issue
Block a user
Split from #401. Third of three.
Start only once #405 (
wafdecides in parallel) is merged intonext. Both change test files, and #401 (comment) put them in this order.What sneak asked for
As many tests as possible run in parallel, in goroutines (reworded from #403 (comment)).
Where the code is today
Nearly there. Of about 850 tests, all but six call
t.Parallel()or are insidetesting/synctest. Theparalleltestlinter already fails a test that does neither without a stated reason.go testgives each package a process of its own, and the two test passes in theDockerfileare built at the same time.The six that go one at a time, each with its reason in a comment:
TestTokenSetEmptyInTheEnvironmentStopsTheStartandTestListSetEmptyInTheEnvironmentReplacesItsDefaultininternal/config/viper_test.go. They set environment variables, which Go forbids in a parallel test.TestCorazaWritesNoFileininternal/coreruleset/coreruleset_test.go. It setsTMPDIRfor the whole test process.TestTheCoreRuleSetInspectsEachWorstCaseRequestInTimeininternal/coreruleset/inspectiontime_test.go. It times inspections.TestQueriesGoToTheResolverSWWDNSBLResolverNamesininternal/reputation/dnsbl_test.go. The comment at the top of that file gives the reason.TestASwitchNotPassedOnClosesTheAppsConnectionininternal/rproxy/rproxy_test.go. Garbage collection started by other tests would hide a connection left open.To build
Done when
make checkpasses.Not checked
The six come from a text scan of the test files, not from the linter. A subtest that does not call
t.Parallel()inside a parallel test would not show in it.Model: fable-5-2
Waits on #405, which this issue says must merge into
nextfirst; it is still open with no PR.Model: opus-5-5