[ARVADOS] updated: 1.3.0-489-g2b952ed95
Git user
git at public.curoverse.com
Mon Mar 11 00:35:43 EDT 2019
Summary of changes:
lib/dispatchcloud/test/stub_driver.go | 4 +++-
lib/dispatchcloud/worker/pool_test.go | 17 +++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
via 2b952ed950affd0904da21e2dc7c7bf5cdd7d1ce (commit)
via 9c8481b0ceac24a4af4b7caca72e60b0e446d28e (commit)
from fb9f29b33a380616211a56973045dac1254977ee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 2b952ed950affd0904da21e2dc7c7bf5cdd7d1ce
Merge: fb9f29b33 9c8481b0c
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Mar 11 00:34:33 2019 -0400
Merge branch '14938-unreliable-test'
fixes #14938
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
commit 9c8481b0ceac24a4af4b7caca72e60b0e446d28e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Mar 11 00:32:22 2019 -0400
14938: Fix unreliable test.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/lib/dispatchcloud/test/stub_driver.go b/lib/dispatchcloud/test/stub_driver.go
index 5873e4922..4df39d0c4 100644
--- a/lib/dispatchcloud/test/stub_driver.go
+++ b/lib/dispatchcloud/test/stub_driver.go
@@ -371,7 +371,9 @@ func (si stubInstance) SetTags(tags cloud.InstanceTags) error {
}
func (si stubInstance) Tags() cloud.InstanceTags {
- return si.tags
+ // Return a copy to ensure a caller can't change our saved
+ // tags just by writing to the returned map.
+ return copyTags(si.tags)
}
func (si stubInstance) String() string {
diff --git a/lib/dispatchcloud/worker/pool_test.go b/lib/dispatchcloud/worker/pool_test.go
index da9e650b8..fc33a7ab2 100644
--- a/lib/dispatchcloud/worker/pool_test.go
+++ b/lib/dispatchcloud/worker/pool_test.go
@@ -105,6 +105,23 @@ func (suite *PoolSuite) TestResumeAfterRestart(c *check.C) {
pool.SetIdleBehavior(heldInstanceID, IdleBehaviorHold)
}
}
+ // Wait for the tags to save to the cloud provider
+ 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 false
+ }() {
+ if time.Now().After(deadline) {
+ c.Fatal("timeout")
+ }
+ time.Sleep(time.Millisecond * 10)
+ }
pool.Stop()
c.Log("------- starting new pool, waiting to recover state")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list