[ARVADOS] updated: 1.1.3-317-g74b20eb

Git user git at public.curoverse.com
Wed Apr 4 15:24:01 EDT 2018


Summary of changes:
 services/crunch-run/crunchrun_test.go     | 2 ++
 services/keep-web/server_test.go          | 1 -
 services/keepproxy/keepproxy.go           | 8 ++++----
 services/keepproxy/keepproxy_test.go      | 6 +++++-
 services/keepstore/s3_volume_test.go      | 6 +++---
 services/keepstore/volume_generic_test.go | 2 +-
 services/keepstore/volume_unix.go         | 5 +++++
 7 files changed, 20 insertions(+), 10 deletions(-)

       via  74b20ebe687946ba844db675b31865e5f055d59b (commit)
       via  9dc405e38ed0a977f5466ea909dd416cd192a20b (commit)
      from  396cb080346a46a94508b2938ef6d916f4d1778f (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 74b20ebe687946ba844db675b31865e5f055d59b
Author: Ward Vandewege <wvandewege at veritasgenetics.com>
Date:   Wed Apr 4 15:23:45 2018 -0400

    Fix more ineffassign warnings in our golang code.
    
    refs #
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege at veritasgenetics.com>

diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 48da8ed..ba91959 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -416,6 +416,7 @@ func (s *TestSuite) TestLoadImage(c *C) {
 	cr := NewContainerRunner(&ArvTestClient{}, kc, s.docker, "zzzzz-zzzzz-zzzzzzzzzzzzzzz")
 
 	_, err := cr.Docker.ImageRemove(nil, hwImageId, dockertypes.ImageRemoveOptions{})
+	c.Check(err, IsNil)
 
 	_, _, err = cr.Docker.ImageInspectWithRaw(nil, hwImageId)
 	c.Check(err, NotNil)
@@ -1946,6 +1947,7 @@ func (s *TestSuite) TestEvalSymlinks(c *C) {
 
 	for _, v := range []string{"p1", "p2", "p3", "p4", "p5"} {
 		info, err := os.Lstat(realTemp + "/" + v)
+		c.Assert(err, IsNil)
 		_, _, _, err = cr.derefOutputSymlink(realTemp+"/"+v, info)
 		c.Assert(err, NotNil)
 	}
diff --git a/services/keep-web/server_test.go b/services/keep-web/server_test.go
index 21fa8a4..02f03d0 100644
--- a/services/keep-web/server_test.go
+++ b/services/keep-web/server_test.go
@@ -273,7 +273,6 @@ func (s *IntegrationSuite) runCurl(c *check.C, token, host, uri string, args ...
 	// Discard (but measure size of) anything past 128 MiB.
 	var discarded int64
 	if err == io.ErrUnexpectedEOF {
-		err = nil
 		buf = buf[:n]
 	} else {
 		c.Assert(err, check.Equals, nil)
diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index 1b9f627..65e22e3 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -125,6 +125,7 @@ func (s *ServerRequiredSuite) TestResponseViaHeader(c *C) {
 	req, err := http.NewRequest("POST",
 		"http://"+listener.Addr().String()+"/",
 		strings.NewReader("TestViaHeader"))
+	c.Assert(err, Equals, nil)
 	req.Header.Add("Authorization", "OAuth2 "+arvadostest.ActiveToken)
 	resp, err := (&http.Client{}).Do(req)
 	c.Assert(err, Equals, nil)
@@ -407,6 +408,7 @@ func (s *ServerRequiredSuite) TestCorsHeaders(c *C) {
 		req, err := http.NewRequest("OPTIONS",
 			fmt.Sprintf("http://%s/%x+3", listener.Addr().String(), md5.Sum([]byte("foo"))),
 			nil)
+		c.Assert(err, IsNil)
 		req.Header.Add("Access-Control-Request-Method", "PUT")
 		req.Header.Add("Access-Control-Request-Headers", "Authorization, X-Keep-Desired-Replicas")
 		resp, err := client.Do(req)
@@ -437,6 +439,7 @@ func (s *ServerRequiredSuite) TestPostWithoutHash(c *C) {
 		req, err := http.NewRequest("POST",
 			"http://"+listener.Addr().String()+"/",
 			strings.NewReader("qux"))
+		c.Check(err, IsNil)
 		req.Header.Add("Authorization", "OAuth2 "+arvadostest.ActiveToken)
 		req.Header.Add("Content-Type", "application/octet-stream")
 		resp, err := client.Do(req)
@@ -484,9 +487,10 @@ func (s *ServerRequiredSuite) TestGetIndex(c *C) {
 	c.Check(err, Equals, nil)
 
 	reader, blocklen, _, err := kc.Get(hash)
-	c.Assert(err, Equals, nil)
+	c.Assert(err, IsNil)
 	c.Check(blocklen, Equals, int64(10))
 	all, err := ioutil.ReadAll(reader)
+	c.Assert(err, IsNil)
 	c.Check(all, DeepEquals, data)
 
 	// Put some more blocks
diff --git a/services/keepstore/s3_volume_test.go b/services/keepstore/s3_volume_test.go
index 4081e1e..10c7112 100644
--- a/services/keepstore/s3_volume_test.go
+++ b/services/keepstore/s3_volume_test.go
@@ -355,7 +355,7 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) {
 		}
 
 		// Call Trash, then check canTrash and canGetAfterTrash
-		loc, blk = setupScenario()
+		loc, _ = setupScenario()
 		err = v.Trash(loc)
 		c.Check(err == nil, check.Equals, scenario.canTrash)
 		_, err = v.Get(context.Background(), loc, buf)
@@ -365,7 +365,7 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) {
 		}
 
 		// Call Untrash, then check canUntrash
-		loc, blk = setupScenario()
+		loc, _ = setupScenario()
 		err = v.Untrash(loc)
 		c.Check(err == nil, check.Equals, scenario.canUntrash)
 		if scenario.dataT != none || scenario.trashT != none {
@@ -379,7 +379,7 @@ func (s *StubbedS3Suite) TestBackendStates(c *check.C) {
 
 		// Call EmptyTrash, then check haveTrashAfterEmpty and
 		// freshAfterEmpty
-		loc, blk = setupScenario()
+		loc, _ = setupScenario()
 		v.EmptyTrash()
 		_, err = v.bucket.Head("trash/"+loc, nil)
 		c.Check(err == nil, check.Equals, scenario.haveTrashAfterEmpty)
diff --git a/services/keepstore/volume_generic_test.go b/services/keepstore/volume_generic_test.go
index a9b96a4..23a17fd 100644
--- a/services/keepstore/volume_generic_test.go
+++ b/services/keepstore/volume_generic_test.go
@@ -932,7 +932,7 @@ func testTrashEmptyTrashUntrash(t TB, factory TestableVolumeFactory) {
 	// goes away.
 	// (In Azure volumes, un/trash changes Mtime, so first backdate again)
 	v.TouchWithDate(TestHash, time.Now().Add(-2*theConfig.BlobSignatureTTL.Duration()))
-	err = v.Trash(TestHash)
+	_ = v.Trash(TestHash)
 	err = checkGet()
 	if err == nil || !os.IsNotExist(err) {
 		t.Fatalf("os.IsNotExist(%v) should have been true", err)
diff --git a/services/keepstore/volume_unix.go b/services/keepstore/volume_unix.go
index b4f18ad..5a04ffd 100644
--- a/services/keepstore/volume_unix.go
+++ b/services/keepstore/volume_unix.go
@@ -482,6 +482,11 @@ func (v *UnixVolume) IndexTo(prefix string, w io.Writer) error {
 				"+", fileInfo[0].Size(),
 				" ", fileInfo[0].ModTime().UnixNano(),
 				"\n")
+			if err != nil {
+				log.Print("Error writing : ", err)
+				lastErr = err
+				break
+			}
 		}
 		blockdir.Close()
 	}

commit 9dc405e38ed0a977f5466ea909dd416cd192a20b
Author: Ward Vandewege <wvandewege at veritasgenetics.com>
Date:   Wed Apr 4 15:21:20 2018 -0400

    keepproxy: bugfix: do not swallow error if Readall succeeds but PutB fails.
    Found by ineffassign.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege at veritasgenetics.com>

diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 73fbefd..0b17d97 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -521,13 +521,13 @@ func (h *proxyHandler) Put(resp http.ResponseWriter, req *http.Request) {
 
 	// Now try to put the block through
 	if locatorIn == "" {
-		if bytes, err := ioutil.ReadAll(req.Body); err != nil {
-			_ = errors.New(fmt.Sprintf("Error reading request body: %s", err))
+		bytes, err2 := ioutil.ReadAll(req.Body)
+		if err2 != nil {
+			_ = errors.New(fmt.Sprintf("Error reading request body: %s", err2))
 			status = http.StatusInternalServerError
 			return
-		} else {
-			locatorOut, wroteReplicas, err = kc.PutB(bytes)
 		}
+		locatorOut, wroteReplicas, err = kc.PutB(bytes)
 	} else {
 		locatorOut, wroteReplicas, err = kc.PutHR(locatorIn, req.Body, expectLength)
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list