1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
11 "git.curoverse.com/arvados.git/lib/dispatchcloud/test"
12 "git.curoverse.com/arvados.git/sdk/go/arvados"
13 "git.curoverse.com/arvados.git/sdk/go/ctxlog"
14 check "gopkg.in/check.v1"
17 // Ensure the scheduler expunges containers from the queue when they
18 // are no longer relevant (completed and not running, queued with
20 func (*SchedulerSuite) TestForgetIrrelevantContainers(c *check.C) {
21 ctx := ctxlog.Context(context.Background(), ctxlog.TestLogger(c))
24 ChooseType: chooseType,
25 Containers: []arvados.Container{
27 UUID: test.ContainerUUID(1),
29 State: arvados.ContainerStateQueued,
30 RuntimeConstraints: arvados.RuntimeConstraints{
36 UUID: test.ContainerUUID(2),
38 State: arvados.ContainerStateComplete,
39 RuntimeConstraints: arvados.RuntimeConstraints{
48 ents, _ := queue.Entries()
49 c.Check(ents, check.HasLen, 1)
51 sch := New(ctx, &queue, &pool, time.Millisecond, time.Millisecond)
54 ents, _ = queue.Entries()
55 c.Check(ents, check.HasLen, 0)