From: Lucas Di Pentima Date: Thu, 22 Jul 2021 20:24:26 +0000 (-0300) Subject: 16665: Exposes bug through updated test. X-Git-Tag: 2.3.0~130^2~2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/7533276a8b444ac3d49f74c8da0fb31d8caf2650?ds=sidebyside;hp=e1cee0a8ebb0728bcb62e89530c11ea8dc072371 16665: Exposes bug through updated test. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go index c49fbe0bb3..f02971d61b 100644 --- a/services/keepproxy/keepproxy_test.go +++ b/services/keepproxy/keepproxy_test.go @@ -265,12 +265,16 @@ func (s *ServerRequiredSuite) TestDesiredReplicas(c *C) { content := []byte("TestDesiredReplicas") hash := fmt.Sprintf("%x", md5.Sum(content)) - for _, kc.Want_replicas = range []int{0, 1, 2} { + for _, kc.Want_replicas = range []int{0, 1, 2, 3} { locator, rep, err := kc.PutB(content) - c.Check(err, Equals, nil) - c.Check(rep, Equals, kc.Want_replicas) - if rep > 0 { - c.Check(locator, Matches, fmt.Sprintf(`^%s\+%d(\+.+)?$`, hash, len(content))) + if kc.Want_replicas < 3 { + c.Check(err, Equals, nil) + c.Check(rep, Equals, kc.Want_replicas) + if rep > 0 { + c.Check(locator, Matches, fmt.Sprintf(`^%s\+%d(\+.+)?$`, hash, len(content))) + } + } else { + c.Check(err, ErrorMatches, ".*503.*") } } }