diff --git a/app/discovery/discovery.go b/app/discovery/discovery.go index cf96e7c..4e64a57 100644 --- a/app/discovery/discovery.go +++ b/app/discovery/discovery.go @@ -252,6 +252,9 @@ func (s *Service) Mappers() (mappers []URLMapper) { for _, m := range s.mappers { mappers = append(mappers, m...) } + sort.Slice(mappers, func(i, j int) bool { + return mappers[i].ProviderID < mappers[j].ProviderID + }) return mappers } diff --git a/app/proxy/proxy_test.go b/app/proxy/proxy_test.go index a4d93ca..268ed1c 100644 --- a/app/proxy/proxy_test.go +++ b/app/proxy/proxy_test.go @@ -109,7 +109,7 @@ func TestHttp_DoWithAssets(t *testing.T) { cc := NewCacheControl(time.Hour * 12) h := Http{Timeouts: Timeouts{ResponseHeader: 200 * time.Millisecond}, Address: fmt.Sprintf("127.0.0.1:%d", port), AccessLog: io.Discard, AssetsWebRoot: "/static", AssetsLocation: "testdata", CacheControl: cc, Reporter: &ErrorReporter{Nice: false}} - ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), 1000*time.Millisecond) defer cancel() ds := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -136,7 +136,7 @@ func TestHttp_DoWithAssets(t *testing.T) { go func() { _ = h.Run(ctx) }() - time.Sleep(10 * time.Millisecond) + time.Sleep(50 * time.Millisecond) client := http.Client{}