[ARVADOS] updated: c6df16d2af30e989bcfb04f6ef730cde658a9dc9

Git user git at public.curoverse.com
Wed Mar 9 11:43:39 EST 2016


Summary of changes:
 services/datamanager/datamanager.go      |  2 +-
 services/datamanager/datamanager_test.go | 26 ++++++++++++++++++++++++--
 2 files changed, 25 insertions(+), 3 deletions(-)

       via  c6df16d2af30e989bcfb04f6ef730cde658a9dc9 (commit)
       via  d54cd5298bb6e043205995c6e5d414a841d9c389 (commit)
       via  e5ee153a56578d13a025cde47fd0c07e21fd975f (commit)
       via  0e97dd2d9fe31a6c1cf73471e6e5ca1f33500850 (commit)
      from  2dbbaaefc6a4a46a7f17b9e7799fc455cd722113 (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 c6df16d2af30e989bcfb04f6ef730cde658a9dc9
Merge: 2dbbaae d54cd52
Author: radhika <radhika at curoverse.com>
Date:   Wed Mar 9 11:43:18 2016 -0500

    closes #8508
    Merge branch 'wtsi-hgi-8508-datamanager-test-badpaths'


commit d54cd5298bb6e043205995c6e5d414a841d9c389
Author: radhika <radhika at curoverse.com>
Date:   Wed Mar 9 11:41:57 2016 -0500

    8508: go fmt

diff --git a/services/datamanager/datamanager.go b/services/datamanager/datamanager.go
index 604a6db..312bea0 100644
--- a/services/datamanager/datamanager.go
+++ b/services/datamanager/datamanager.go
@@ -204,7 +204,7 @@ func BuildDataFetcher(arv arvadosclient.ArvadosClient) summary.DataFetcher {
 				Logger: arvLogger,
 				Limit:  1000})
 
-		<- collDone
+		<-collDone
 
 		// Return a nil error only if both parts succeeded.
 		if collErr != nil {
diff --git a/services/datamanager/datamanager_test.go b/services/datamanager/datamanager_test.go
index 523bbf1..a99ec6b 100644
--- a/services/datamanager/datamanager_test.go
+++ b/services/datamanager/datamanager_test.go
@@ -12,11 +12,11 @@ import (
 	"net/http"
 	"os"
 	"os/exec"
+	"path"
 	"regexp"
 	"strings"
 	"testing"
 	"time"
-	"path"
 )
 
 var arv arvadosclient.ArvadosClient
@@ -547,14 +547,12 @@ func createBadPath(t *testing.T) (badpath string) {
 	return
 }
 
-func destroyBadPath(t *testing.T, badpath string) () {
+func destroyBadPath(t *testing.T, badpath string) {
 	tempdir := path.Join(badpath, "..")
 	err := os.Remove(tempdir)
 	if err != nil {
 		t.Fatalf("Could not remove bad path temporary directory %v: %v", tempdir, err)
-		return
 	}
-	return
 }
 
 func TestPutAndGetBlocks_ErrorDuringGetCollectionsBadWriteTo(t *testing.T) {

commit e5ee153a56578d13a025cde47fd0c07e21fd975f
Merge: a6e2465 0e97dd2
Author: radhika <radhika at curoverse.com>
Date:   Thu Mar 3 10:38:11 2016 -0500

    Merge branch '8508-datamanager-test-badpaths' of https://github.com/wtsi-hgi/arvados into wtsi-hgi-8508-datamanager-test-badpaths


commit 0e97dd2d9fe31a6c1cf73471e6e5ca1f33500850
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sun Feb 21 11:56:07 2016 +0000

    Fixes 8508 by creating a bad path explicitly
    
    Rather than assuming we can't write to '/', this change
    creates a temporary directory and then refers to a nonexistent
    path within it.

diff --git a/services/datamanager/datamanager_test.go b/services/datamanager/datamanager_test.go
index 67b0e79..523bbf1 100644
--- a/services/datamanager/datamanager_test.go
+++ b/services/datamanager/datamanager_test.go
@@ -16,6 +16,7 @@ import (
 	"strings"
 	"testing"
 	"time"
+	"path"
 )
 
 var arv arvadosclient.ArvadosClient
@@ -537,12 +538,35 @@ func TestPutAndGetBlocks_NoErrorDuringSingleRun(t *testing.T) {
 	testOldBlocksNotDeletedOnDataManagerError(t, "", "", false, false)
 }
 
+func createBadPath(t *testing.T) (badpath string) {
+	tempdir, err := ioutil.TempDir("", "bad")
+	if err != nil {
+		t.Fatalf("Could not create temporary directory for bad path: %v", err)
+	}
+	badpath = path.Join(tempdir, "bad")
+	return
+}
+
+func destroyBadPath(t *testing.T, badpath string) () {
+	tempdir := path.Join(badpath, "..")
+	err := os.Remove(tempdir)
+	if err != nil {
+		t.Fatalf("Could not remove bad path temporary directory %v: %v", tempdir, err)
+		return
+	}
+	return
+}
+
 func TestPutAndGetBlocks_ErrorDuringGetCollectionsBadWriteTo(t *testing.T) {
-	testOldBlocksNotDeletedOnDataManagerError(t, "/badwritetofile", "", true, true)
+	badpath := createBadPath(t)
+	defer destroyBadPath(t, badpath)
+	testOldBlocksNotDeletedOnDataManagerError(t, path.Join(badpath, "writetofile"), "", true, true)
 }
 
 func TestPutAndGetBlocks_ErrorDuringGetCollectionsBadHeapProfileFilename(t *testing.T) {
-	testOldBlocksNotDeletedOnDataManagerError(t, "", "/badheapprofilefile", true, true)
+	badpath := createBadPath(t)
+	defer destroyBadPath(t, badpath)
+	testOldBlocksNotDeletedOnDataManagerError(t, "", path.Join(badpath, "heapprofilefile"), true, true)
 }
 
 // Create some blocks and backdate some of them.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list