[ARVADOS] updated: b84068982f17bebc093a3cc54b6b4fa0e4bf3a77

Git user git at public.curoverse.com
Thu May 12 10:23:46 EDT 2016


Summary of changes:
 services/crunch-dispatch-local/crunch-dispatch-local.go    | 14 +++++++-------
 .../crunch-dispatch-local/crunch-dispatch-local_test.go    |  2 +-
 .../crunch-dispatch-slurm/crunch-dispatch-slurm_test.go    |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

       via  b84068982f17bebc093a3cc54b6b4fa0e4bf3a77 (commit)
       via  2e34fd27dc93b091c3862b763cf9d1569317dc0f (commit)
      from  cbc54fdb06a96a54760c7e2bdd47e92be8f212f6 (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 b84068982f17bebc093a3cc54b6b4fa0e4bf3a77
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu May 12 10:23:31 2016 -0400

    8128: Fix test race.

diff --git a/services/crunch-dispatch-local/crunch-dispatch-local.go b/services/crunch-dispatch-local/crunch-dispatch-local.go
index 848d723..4023870 100644
--- a/services/crunch-dispatch-local/crunch-dispatch-local.go
+++ b/services/crunch-dispatch-local/crunch-dispatch-local.go
@@ -131,10 +131,14 @@ func dispatchLocal(pollInterval time.Duration, crunchRunCommand string) {
 		return
 	}
 
-	for i := 0; i < len(containers.Items); i++ {
-		log.Printf("About to run queued container %v", containers.Items[i].UUID)
+	for _, c := range containers.Items {
+		log.Printf("About to run queued container %v", c.UUID)
 		// Run the container
-		go run(containers.Items[i].UUID, crunchRunCommand, pollInterval)
+		waitGroup.Add(1)
+		go func(c Container) {
+			run(c.UUID, crunchRunCommand, pollInterval)
+			waitGroup.Done()
+		}(c)
 	}
 }
 
@@ -187,10 +191,6 @@ func run(uuid string, crunchRunCommand string, pollInterval time.Duration) {
 
 	log.Printf("Starting container %v", uuid)
 
-	// Add this crunch job to waitGroup
-	waitGroup.Add(1)
-	defer waitGroup.Done()
-
 	updateState(uuid, "Running")
 
 	cmdExited := make(chan struct{})

commit 2e34fd27dc93b091c3862b763cf9d1569317dc0f
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu May 12 10:09:29 2016 -0400

    8128: Fix unreasonably short poll intervals in tests.

diff --git a/services/crunch-dispatch-local/crunch-dispatch-local_test.go b/services/crunch-dispatch-local/crunch-dispatch-local_test.go
index baa1478..e3ab3a4 100644
--- a/services/crunch-dispatch-local/crunch-dispatch-local_test.go
+++ b/services/crunch-dispatch-local/crunch-dispatch-local_test.go
@@ -147,7 +147,7 @@ func testWithServerStub(c *C, apiStubResponses map[string]arvadostest.StubRespon
 		sigChan <- syscall.SIGTERM
 	}()
 
-	runQueuedContainers(1, 1, crunchCmd)
+	runQueuedContainers(time.Second, time.Second, crunchCmd)
 
 	// Wait for all running crunch jobs to complete / terminate
 	waitGroup.Wait()
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
index 3dfb7d5..73ad613 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@ -172,7 +172,7 @@ func testWithServerStub(c *C, apiStubResponses map[string]arvadostest.StubRespon
 		sigChan <- syscall.SIGTERM
 	}()
 
-	runQueuedContainers(2, 1, crunchCmd, crunchCmd)
+	runQueuedContainers(2*time.Second, time.Second, crunchCmd, crunchCmd)
 
 	c.Check(buf.String(), Matches, `(?ms).*`+expected+`.*`)
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list