diff options
| author | Sonia Appasamy <sonia@tailscale.com> | 2023-08-29 21:50:45 -0400 |
|---|---|---|
| committer | Sonia Appasamy <sonia@tailscale.com> | 2023-08-29 21:54:40 -0400 |
| commit | b772c071b1c2f8a4f92d2727ecb69a5f724e6e59 (patch) | |
| tree | ae230fd8c69fd7d53a7bf46098f4f87ce46f98aa | |
| parent | 7538f386710b80c6b4c1997797be28a661210d4a (diff) | |
| download | tailscale-soniaappasamy/fix-test-flake.tar.xz tailscale-soniaappasamy/fix-test-flake.zip | |
client/web: fix data race in testsoniaappasamy/fix-test-flake
Fixes #9150
Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
| -rw-r--r-- | client/web/web_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/web/web_test.go b/client/web/web_test.go index fbfd8ad18..d8c25107e 100644 --- a/client/web/web_test.go +++ b/client/web/web_test.go @@ -76,14 +76,16 @@ func TestQnapAuthnURL(t *testing.T) { // 2. localapi proxy allowlist func TestServeAPI(t *testing.T) { lal := memnet.Listen("local-tailscaled.sock:80") - defer lal.Close() // Serve dummy localapi. Just returns "success". go func() { localapi := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "success") })} + defer localapi.Close() + defer lal.Close() + if err := localapi.Serve(lal); err != nil { t.Error(err) } |
