mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 03:31:39 +00:00
client/web: fix data race
Fixes #9150 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
7538f38671
commit
b90b9b4653
@ -77,17 +77,13 @@ func TestQnapAuthnURL(t *testing.T) {
|
|||||||
func TestServeAPI(t *testing.T) {
|
func TestServeAPI(t *testing.T) {
|
||||||
lal := memnet.Listen("local-tailscaled.sock:80")
|
lal := memnet.Listen("local-tailscaled.sock:80")
|
||||||
defer lal.Close()
|
defer lal.Close()
|
||||||
|
|
||||||
// Serve dummy localapi. Just returns "success".
|
// Serve dummy localapi. Just returns "success".
|
||||||
go func() {
|
|
||||||
localapi := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
localapi := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintf(w, "success")
|
fmt.Fprintf(w, "success")
|
||||||
})}
|
})}
|
||||||
defer localapi.Close()
|
defer localapi.Close()
|
||||||
if err := localapi.Serve(lal); err != nil {
|
|
||||||
t.Error(err)
|
go localapi.Serve(lal)
|
||||||
}
|
|
||||||
}()
|
|
||||||
s := &Server{lc: &tailscale.LocalClient{Dial: lal.Dial}}
|
s := &Server{lc: &tailscale.LocalClient{Dial: lal.Dial}}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user