|
@@ -937,6 +937,10 @@ func TestApiCache(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func startHTTP(cfg config.Wrapper) (string, context.CancelFunc, error) {
|
|
|
+ return startHTTPWithShutdownTimeout(cfg, 0)
|
|
|
+}
|
|
|
+
|
|
|
+func startHTTPWithShutdownTimeout(cfg config.Wrapper, shutdownTimeout time.Duration) (string, context.CancelFunc, error) {
|
|
|
m := new(modelmocks.Model)
|
|
|
assetDir := "../../gui"
|
|
|
eventSub := new(eventmocks.BufferedSubscription)
|
|
@@ -964,6 +968,10 @@ func startHTTP(cfg config.Wrapper) (string, context.CancelFunc, error) {
|
|
|
svc := New(protocol.LocalDeviceID, cfg, assetDir, "syncthing", m, eventSub, diskEventSub, events.NoopLogger, discoverer, connections, urService, mockedSummary, errorLog, systemLog, false, kdb).(*service)
|
|
|
svc.started = addrChan
|
|
|
|
|
|
+ if shutdownTimeout > 0*time.Millisecond {
|
|
|
+ svc.shutdownTimeout = shutdownTimeout
|
|
|
+ }
|
|
|
+
|
|
|
// Actually start the API service
|
|
|
supervisor := suture.New("API test", suture.Spec{
|
|
|
PassThroughPanics: true,
|