diff --git a/registry/client/auth/authchallenge_test.go b/registry/client/auth/authchallenge_test.go index e4f81d28..f1b321a7 100644 --- a/registry/client/auth/authchallenge_test.go +++ b/registry/client/auth/authchallenge_test.go @@ -103,35 +103,24 @@ func testAuthChallengeConcurrent(t *testing.T, host string) { var s sync.WaitGroup s.Add(2) go func() { - i := 200 - for { - //time.Sleep(500 * time.Millisecond) + + for i:=0 ; i<200; i++ { err = scm.AddResponse(resp) if err != nil { t.Fatal(err) } - i = i -1 - if i < 0{ - break - } } s.Done() }() go func() { lowered := *url lowered.Host = strings.ToLower(lowered.Host) - k:= 200 - for { + for k := 0; k < 200 ; k++ { _, err := scm.GetChallenges(lowered) if err != nil { t.Fatal(err) } - k = k -1 - if k < 0{ - break - } } - s.Done() }() s.Wait()