chore: fix TestTailnet/ForcesWebSockets flake (#8953)

This commit is contained in:
Colin Adler
2023-08-07 21:17:39 -05:00
committed by GitHub
parent 827de08007
commit 758c368222
3 changed files with 3 additions and 3 deletions
-1
View File
@@ -13,7 +13,6 @@ import (
"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/dbauthz"
"github.com/coder/coder/codersdk/agentsdk"
+1 -1
View File
@@ -99,7 +99,7 @@ func TestTailnet(t *testing.T) {
t.Run("ForcesWebSockets", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitMedium)
w1IP := tailnet.IP()
derpMap := tailnettest.RunDERPOnlyWebSockets(t)
+2 -1
View File
@@ -77,7 +77,8 @@ func RunDERPOnlyWebSockets(t *testing.T) *tailcfg.DERPMap {
handler, closeFunc = tailnet.WithWebsocketSupport(d, handler)
server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/derp" {
handler.ServeHTTP(w, r)
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("hello"))
return
}
if r.Header.Get("Upgrade") != "websocket" {