all: Implement suture v4-api (#6947)

This commit is contained in:
Simon Frei
2020-11-17 13:19:04 +01:00
committed by GitHub
parent e8fc465ea8
commit 9524b51708
65 changed files with 617 additions and 693 deletions
+6 -4
View File
@@ -200,8 +200,9 @@ func TestGlobalAnnounce(t *testing.T) {
t.Fatal(err)
}
go disco.Serve()
defer disco.Stop()
ctx, cancel := context.WithCancel(context.Background())
go disco.Serve(ctx)
defer cancel()
// The discovery thing should attempt an announcement immediately. We wait
// for it to succeed, a while.
@@ -223,8 +224,9 @@ func testLookup(url string) ([]string, error) {
if err != nil {
return nil, err
}
go disco.Serve()
defer disco.Stop()
ctx, cancel := context.WithCancel(context.Background())
go disco.Serve(ctx)
defer cancel()
return disco.Lookup(context.Background(), protocol.LocalDeviceID)
}