Add telemetry to diagnose intermittent macOS `test-go-pg` stalls and preserve timeout diagnostics. - Log runner details at startup; sample load, swap, and `vm_stat` every second and `top` every 10 seconds to identify runner-wide pauses. - Add stall detection to `cli` and `agent` `TestMain`, logging heap, GC, and goroutine counts when ticks arrive more than 5 seconds late. - Run artifact uploads with `always() && !success()` so canceled test steps do not skip diagnostics. - Add a `TEST_TIMEOUT` override: use 20m on macOS to leave room for goroutine dumps within the 30m job, retaining the 25m default for the nightly gauntlet. Validated with race tests, binary compilation, `actionlint`, local macOS checks, and Makefile timeout checks.
25 lines
395 B
Go
25 lines
395 B
Go
package testutil_test
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/coder/coder/v2/testutil"
|
|
)
|
|
|
|
func TestStartStallDetector(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
stop := testutil.StartStallDetector(time.Hour)
|
|
stopped := make(chan struct{})
|
|
go func() {
|
|
defer close(stopped)
|
|
stop()
|
|
}()
|
|
select {
|
|
case <-stopped:
|
|
case <-time.After(testutil.WaitShort):
|
|
t.Fatal("stall detector did not stop")
|
|
}
|
|
}
|