mirror of
https://github.com/git-pkgs/proxy.git
synced 2026-09-15 23:32:04 -04:00
Compare commits
1 changed files with 2 additions and 5 deletions
|
|
@ -237,7 +237,7 @@ func testStartUsesConfiguredLoopbackUpstreams(t *testing.T) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
probeClient := &http.Client{Timeout: 250 * time.Millisecond}
|
client := &http.Client{Timeout: 250 * time.Millisecond}
|
||||||
deadline := time.Now().Add(5 * time.Second)
|
deadline := time.Now().Add(5 * time.Second)
|
||||||
for {
|
for {
|
||||||
req, err := http.NewRequest(http.MethodGet, cfg.BaseURL+"/pypi/simple/ruff/", nil)
|
req, err := http.NewRequest(http.MethodGet, cfg.BaseURL+"/pypi/simple/ruff/", nil)
|
||||||
|
|
@ -245,7 +245,7 @@ func testStartUsesConfiguredLoopbackUpstreams(t *testing.T) {
|
||||||
t.Fatalf("creating request: %v", err)
|
t.Fatalf("creating request: %v", err)
|
||||||
}
|
}
|
||||||
req.Header.Set("Accept", "application/vnd.pypi.simple.v1+json")
|
req.Header.Set("Accept", "application/vnd.pypi.simple.v1+json")
|
||||||
resp, requestErr := probeClient.Do(req)
|
resp, requestErr := client.Do(req)
|
||||||
if requestErr == nil {
|
if requestErr == nil {
|
||||||
body, readErr := io.ReadAll(resp.Body)
|
body, readErr := io.ReadAll(resp.Body)
|
||||||
_ = resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
|
|
@ -266,9 +266,6 @@ func testStartUsesConfiguredLoopbackUpstreams(t *testing.T) {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This checks upstream routing, not latency. Allow time for fetching and
|
|
||||||
// cache I/O under -race on slower CI workers.
|
|
||||||
client := &http.Client{Timeout: 5 * time.Second}
|
|
||||||
resp, err := client.Get(cfg.BaseURL + "/v2/library/demo/manifests/latest")
|
resp, err := client.Get(cfg.BaseURL + "/v2/library/demo/manifests/latest")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("OCI request failed: %v", err)
|
t.Fatalf("OCI request failed: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue