Make the load-sensitive tests wait for what they check (closes #507)
check / check (push) Successful in 9m48s
check / check (push) Successful in 9m48s
Three tests failed at random on a busy host. The browser test now waits for each page a click opens to load, and for Alpine.js to start on it, before reading it. The delivery tests' drain takes what is already queued instead of racing a 25 ms timer, since both dispatch paths queue before they return. The test phase keeps the tests' temporary directories on a tmpfs, because SQLite waiting for the disk made `internal/handlers` slow under load; the timeout and the parallel cap are unchanged. Deviation: the delivery tests do not wait with a deadline; dispatch has finished when they read. Unverified: `internal/handlers` at a host load of 260 to 290. Model: opus-5-5
This commit was merged in pull request #510.
This commit is contained in:
@@ -48,8 +48,9 @@ func fSweepSetup(
|
||||
//
|
||||
// Every caller drives the dispatch paths synchronously and has already
|
||||
// waited for them to return, so anything they queued is in the channel
|
||||
// by now. The short grace covers nothing but scheduler jitter, and is
|
||||
// kept small because one of these tests runs the drain forty times.
|
||||
// by now, and nothing is waited for. A timer here would race the queued
|
||||
// tasks: on a busy host it can be due by the time select looks, and
|
||||
// select picks at random among the cases that are ready.
|
||||
func fDrain(e *delivery.Engine) []delivery.Task {
|
||||
var out []delivery.Task
|
||||
|
||||
@@ -59,7 +60,7 @@ func fDrain(e *delivery.Engine) []delivery.Task {
|
||||
out = append(out, task)
|
||||
case task := <-e.ExportRetryCh():
|
||||
out = append(out, task)
|
||||
case <-time.After(25 * time.Millisecond):
|
||||
default:
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user