coder / internal

Non-community issues related to coder/coder
2 stars 0 forks source link

flake: TestHealthSettings/UnDismissSection #194

Open johnstcn opened 2 days ago

johnstcn commented 2 days ago

Seen here: https://github.com/coder/coder/actions/runs/11669113262/job/32490361705?pr=15364

    debug_test.go:328: 
            Error Trace:    /Users/runner/work/coder/coder/coderd/debug_test.go:328
            Error:          Received unexpected error:
                            Get "http://localhost:53978/api/v2/debug/health": context deadline exceeded
            Test:           TestHealthSettings/UnDismissSection
Emyrk commented 2 days ago

First user http request: 17:09:41.951 Early test requests:

    t.go:99: 2024-11-04 17:09:41.953 [debu]  coderd: PUT  host=localhost:53978  path=/api/v2/debug/health/settings  proto=HTTP/1.1  remote_addr=127.0.0.1  start="2024-11-04T17:09:41.952115Z"  took=1.515916ms  status_code=200  latency_ms=1  request_id=865f68ab-dd4c-4dec-b5dc-af44f4f2acbb
    t.go:99: 2024-11-04 17:09:41.955 [debu]  coderd: PUT  host=localhost:53978  path=/api/v2/debug/health/settings  proto=HTTP/1.1  remote_addr=127.0.0.1  start="2024-11-04T17:09:41.954785Z"  took=664.667µs  status_code=200  latency_ms=0  request_id=2091fe81-ce81-4566-8ba9-8619b5d971bb
    t.go:99: 2024-11-04 17:09:41.956 [debu]  coderd: GET  host=localhost:53978  path=/api/v2/debug/health/settings  proto=HTTP/1.1  remote_addr=127.0.0.1  start="2024-11-04T17:09:41.956254Z"  took=140.666µs  status_code=200  latency_ms=0  request_id=80a40df2-c44d-45ad-836a-b4da2afa3bd9

Logs just jump 10s:

    t.go:99: 2024-11-04 17:09:42.008 [debu]  coderd: GET  host=127.0.0.1:53978  path=/derp/latency-check  proto=HTTP/1.1  remote_addr=127.0.0.1  start="2024-11-04T17:09:42.008329Z"  took=45.666µs  status_code=200  latency_ms=0  request_id=f8d8fec9-adf7-4dc0-8bad-381fa18451cb
    debug_test.go:328: 
            Error Trace:    /Users/runner/work/coder/coder/coderd/debug_test.go:328
            Error:          Received unexpected error:
                            Get "http://localhost:53978/api/v2/debug/health": context deadline exceeded
            Test:           TestHealthSettings/UnDismissSection
    t.go:99: 2024-11-04 17:09:51.916 [debu]  coderd.servertailnet: polling DERPMap exited

I don't see any reason why the test would block for 10s 🤔

johnstcn commented 2 days ago

I wonder if it was the DERP health report that took longer than 10s to complete? I think half the issue here is that the hc is run on request + cached instead of being run in the background.