20318: Fix settled condition.
authorTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 18:10:47 +0000 (13:10 -0500)
committerTom Clegg <tom@curii.com>
Thu, 11 Jan 2024 20:13:28 +0000 (15:13 -0500)
Intention was to stop iterating when *all* of the keepstore servers
need 0 pulls, but the code as written stops on the N>1st iteration
when *any* of the keepstore servers need 0 pulls. This caused a false
negative when it took more than one iteration for keepstore to
complete the requested pulls.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/keep-balance/integration_test.go

index 18cfd121069dfdd3be476c4f016ad7853e73bc51..20d0040b1fa999acc53ae8f9d793581f369a0e0e 100644 (file)
@@ -103,7 +103,7 @@ func (s *integrationSuite) TestBalanceAPIFixtures(c *check.C) {
                if iter == 0 {
                        c.Check(logBuf.String(), check.Matches, `(?ms).*ChangeSet{Pulls:1.*`)
                        c.Check(logBuf.String(), check.Not(check.Matches), `(?ms).*ChangeSet{.*Trashes:[^0]}*`)
-               } else if strings.Contains(logBuf.String(), "ChangeSet{Pulls:0") {
+               } else if !strings.Contains(logBuf.String(), "ChangeSet{Pulls:1") {
                        break
                }
                time.Sleep(200 * time.Millisecond)