all: Make config.Wrapper an actual suture.Service (fixes #7451) (#7452)

This commit is contained in:
Jakob Borg
2021-03-11 14:51:00 +01:00
committed by GitHub
parent df08984a58
commit cdef503db6
8 changed files with 89 additions and 31 deletions
+3 -5
View File
@@ -1262,11 +1262,9 @@ func TestConfigChanges(t *testing.T) {
defer os.Remove(tmpFile.Name())
w := config.Wrap(tmpFile.Name(), cfg, protocol.LocalDeviceID, events.NoopLogger)
tmpFile.Close()
if cfgService, ok := w.(suture.Service); ok {
cfgCtx, cfgCancel := context.WithCancel(context.Background())
go cfgService.Serve(cfgCtx)
defer cfgCancel()
}
cfgCtx, cfgCancel := context.WithCancel(context.Background())
go w.Serve(cfgCtx)
defer cfgCancel()
baseURL, cancel, err := startHTTP(w)
if err != nil {
t.Fatal("Unexpected error from getting base URL:", err)