mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-08 13:46:46 +02:00
client/web: fix data race in test
Fixes #9150 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
parent
7538f38671
commit
b772c071b1
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user