fix: Add latency-check for DERP over HTTP(s) (#3788)

* fix: Add latency-check for DERP over HTTP(s)

This fixes scenarios where latency wasn't being reported if
a connection had UDP entirely blocked.

* Add inactivity ping

* Improve coordinator error reporting consistency
This commit is contained in:
Kyle Carberry
2022-09-01 16:41:47 +00:00
committed by GitHub
parent f4c8bfdc18
commit 6826b976d7
8 changed files with 49 additions and 32 deletions
+10
View File
@@ -2,6 +2,7 @@ package coderd_test
import (
"context"
"net/http"
"net/netip"
"strconv"
"testing"
@@ -114,3 +115,12 @@ func TestDERP(t *testing.T) {
w1.Close()
w2.Close()
}
func TestDERPLatencyCheck(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, nil)
res, err := client.Request(context.Background(), http.MethodGet, "/derp/latency-check", nil)
require.NoError(t, err)
defer res.Body.Close()
require.Equal(t, http.StatusOK, res.StatusCode)
}