18071: Use dblock to avoid concurrent keep-balance ops.
[arvados.git] / services / keep-balance / integration_test.go
index 52e6149158253bdff24705dcb8b6fb7a00f8cb02..42463a002a5ec73652f7f7ef6f00f8a8c4fb44a1 100644 (file)
@@ -2,10 +2,11 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-package main
+package keepbalance
 
 import (
        "bytes"
+       "context"
        "io"
        "os"
        "strings"
@@ -38,7 +39,6 @@ func (s *integrationSuite) SetUpSuite(c *check.C) {
                c.Skip("-short")
        }
        arvadostest.ResetEnv()
-       arvadostest.StartAPI()
        arvadostest.StartKeep(4, true)
 
        arv, err := arvadosclient.MakeArvadosClient()
@@ -62,7 +62,6 @@ func (s *integrationSuite) TearDownSuite(c *check.C) {
                c.Skip("-short")
        }
        arvadostest.StopKeep(4)
-       arvadostest.StopAPI()
 }
 
 func (s *integrationSuite) SetUpTest(c *check.C) {
@@ -99,7 +98,7 @@ func (s *integrationSuite) TestBalanceAPIFixtures(c *check.C) {
                        Logger:  logger,
                        Metrics: newMetrics(prometheus.NewRegistry()),
                }
-               nextOpts, err := bal.Run(s.client, s.config, opts)
+               nextOpts, err := bal.Run(context.Background(), s.client, s.config, opts)
                c.Check(err, check.IsNil)
                c.Check(nextOpts.SafeRendezvousState, check.Not(check.Equals), "")
                c.Check(nextOpts.CommitPulls, check.Equals, true)