Skip to content

Commit 5313884

Browse files
coadlerpull[bot]
authored andcommitted
chore: fix TestTailnet/ForcesWebSockets flake (#8953)
1 parent a832029 commit 5313884

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

coderd/batchstats/batcher.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
"cdr.dev/slog"
1515
"cdr.dev/slog/sloggers/sloghuman"
16-
1716
"github.com/coder/coder/coderd/database"
1817
"github.com/coder/coder/coderd/database/dbauthz"
1918
"github.com/coder/coder/codersdk/agentsdk"

tailnet/conn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func TestTailnet(t *testing.T) {
9999

100100
t.Run("ForcesWebSockets", func(t *testing.T) {
101101
t.Parallel()
102-
ctx := testutil.Context(t, testutil.WaitLong)
102+
ctx := testutil.Context(t, testutil.WaitMedium)
103103

104104
w1IP := tailnet.IP()
105105
derpMap := tailnettest.RunDERPOnlyWebSockets(t)

tailnet/tailnettest/tailnettest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ func RunDERPOnlyWebSockets(t *testing.T) *tailcfg.DERPMap {
7777
handler, closeFunc = tailnet.WithWebsocketSupport(d, handler)
7878
server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
7979
if r.URL.Path != "/derp" {
80-
handler.ServeHTTP(w, r)
80+
w.WriteHeader(http.StatusOK)
81+
_, _ = w.Write([]byte("hello"))
8182
return
8283
}
8384
if r.Header.Get("Upgrade") != "websocket" {

0 commit comments

Comments
 (0)