mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: fix TestTailnet/ForcesWebSockets flake (#8953)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user