[ARVADOS] created: 2.1.0-1843-gc361e5156
Git user
git at public.arvados.org
Tue Jan 25 04:49:25 UTC 2022
at c361e51569e28f30bd034ac240b936346224a0d0 (commit)
commit c361e51569e28f30bd034ac240b936346224a0d0
Author: Tom Clegg <tom at curii.com>
Date: Mon Jan 24 23:48:17 2022 -0500
18670: Fix unreliable test.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/lsf/dispatch.go b/lib/lsf/dispatch.go
index c9ed5582b..0d9324784 100644
--- a/lib/lsf/dispatch.go
+++ b/lib/lsf/dispatch.go
@@ -119,7 +119,7 @@ func (disp *dispatcher) init() {
disp.lsfcli.logger = disp.logger
disp.lsfqueue = lsfqueue{
logger: disp.logger,
- period: time.Duration(disp.Cluster.Containers.CloudVMs.PollInterval),
+ period: disp.Cluster.Containers.CloudVMs.PollInterval.Duration(),
lsfcli: &disp.lsfcli,
}
disp.ArvClient.AuthToken = disp.AuthToken
@@ -256,7 +256,7 @@ func (disp *dispatcher) runContainer(_ *dispatch.Dispatcher, ctr arvados.Contain
// Try "bkill" every few seconds until the LSF job disappears
// from the queue.
- ticker := time.NewTicker(5 * time.Second)
+ ticker := time.NewTicker(disp.Cluster.Containers.CloudVMs.PollInterval.Duration() / 2)
defer ticker.Stop()
for qent, ok := disp.lsfqueue.Lookup(ctr.UUID); ok; _, ok = disp.lsfqueue.Lookup(ctr.UUID) {
err := disp.lsfcli.Bkill(qent.ID)
diff --git a/lib/lsf/dispatch_test.go b/lib/lsf/dispatch_test.go
index c678a9a48..a99983f34 100644
--- a/lib/lsf/dispatch_test.go
+++ b/lib/lsf/dispatch_test.go
@@ -44,7 +44,8 @@ func (s *suite) SetUpTest(c *check.C) {
c.Assert(err, check.IsNil)
cluster, err := cfg.GetCluster("")
c.Assert(err, check.IsNil)
- cluster.Containers.CloudVMs.PollInterval = arvados.Duration(time.Second)
+ cluster.Containers.CloudVMs.PollInterval = arvados.Duration(time.Second / 4)
+ cluster.Containers.MinRetryPeriod = arvados.Duration(time.Second / 4)
s.disp = newHandler(context.Background(), cluster, arvadostest.Dispatch1Token, prometheus.NewRegistry()).(*dispatcher)
s.disp.lsfcli.stubCommand = func(string, ...string) *exec.Cmd {
return exec.Command("bash", "-c", "echo >&2 unimplemented stub; false")
@@ -243,16 +244,19 @@ func (s *suite) TestSubmit(c *check.C) {
}
// "queuedcontainer" should be running
if _, ok := s.disp.lsfqueue.Lookup(arvadostest.QueuedContainerUUID); !ok {
+ c.Log("Lookup(queuedcontainer) == false")
continue
}
// "lockedcontainer" should be cancelled because it
// has priority 0 (no matching container requests)
- if _, ok := s.disp.lsfqueue.Lookup(arvadostest.LockedContainerUUID); ok {
+ if ent, ok := s.disp.lsfqueue.Lookup(arvadostest.LockedContainerUUID); ok {
+ c.Logf("Lookup(lockedcontainer) == true, ent = %#v", ent)
continue
}
// "crTooBig" should be cancelled because lsf stub
// reports there is no suitable instance type
- if _, ok := s.disp.lsfqueue.Lookup(s.crTooBig.ContainerUUID); ok {
+ if ent, ok := s.disp.lsfqueue.Lookup(s.crTooBig.ContainerUUID); ok {
+ c.Logf("Lookup(crTooBig) == true, ent = %#v", ent)
continue
}
var ctr arvados.Container
diff --git a/lib/lsf/lsfqueue.go b/lib/lsf/lsfqueue.go
index 3ed4d0c18..60f01640a 100644
--- a/lib/lsf/lsfqueue.go
+++ b/lib/lsf/lsfqueue.go
@@ -58,7 +58,7 @@ func (q *lsfqueue) getNext() map[string]bjobsEntry {
func (q *lsfqueue) init() {
q.updated = sync.NewCond(&q.mutex)
q.nextReady = make(chan (<-chan struct{}))
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(q.period)
go func() {
for range ticker.C {
// Send a new "next update ready" channel to
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list