X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7109ea1b2a49bc7fdbdbfd2302eb2457750ce5cd..233a2b6bd23a3e2054cfc0690f2bc06c0f9f7323:/lib/dispatchcloud/worker/pool_test.go diff --git a/lib/dispatchcloud/worker/pool_test.go b/lib/dispatchcloud/worker/pool_test.go index 8ab4c98754..4b87ce5031 100644 --- a/lib/dispatchcloud/worker/pool_test.go +++ b/lib/dispatchcloud/worker/pool_test.go @@ -66,7 +66,7 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { logger := ctxlog.TestLogger(c) driver := &test.StubDriver{} instanceSetID := cloud.InstanceSetID("test-instance-set-id") - is, err := driver.InstanceSet(nil, instanceSetID, logger) + is, err := driver.InstanceSet(nil, instanceSetID, nil, logger) c.Assert(err, check.IsNil) newExecutor := func(cloud.Instance) Executor { @@ -83,6 +83,7 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { MaxProbesPerSecond: 1000, ProbeInterval: arvados.Duration(time.Millisecond * 10), SyncInterval: arvados.Duration(time.Millisecond * 10), + TagKeyPrefix: "testprefix:", }, }, InstanceTypes: arvados.InstanceTypeMap{ @@ -107,13 +108,14 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { } } // Wait for the tags to save to the cloud provider + tagKey := cluster.Containers.CloudVMs.TagKeyPrefix + tagKeyIdleBehavior deadline := time.Now().Add(time.Second) for !func() bool { pool.mtx.RLock() defer pool.mtx.RUnlock() for _, wkr := range pool.workers { if wkr.instType == type2 { - return wkr.instance.Tags()[tagKeyIdleBehavior] == string(IdleBehaviorHold) + return wkr.instance.Tags()[tagKey] == string(IdleBehaviorHold) } } return false @@ -145,7 +147,7 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) { func (suite *PoolSuite) TestCreateUnallocShutdown(c *check.C) { logger := ctxlog.TestLogger(c) driver := test.StubDriver{HoldCloudOps: true} - instanceSet, err := driver.InstanceSet(nil, "", logger) + instanceSet, err := driver.InstanceSet(nil, "test-instance-set-id", nil, logger) c.Assert(err, check.IsNil) type1 := arvados.InstanceType{Name: "a1s", ProviderType: "a1.small", VCPUs: 1, RAM: 1 * GiB, Price: .01}