projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
closes #7710
[arvados.git]
/
sdk
/
go
/
keepclient
/
collectionreader_test.go
diff --git
a/sdk/go/keepclient/collectionreader_test.go
b/sdk/go/keepclient/collectionreader_test.go
index 94e41e2bc2d69e50f4e10502aae75c22ef5574b8..58a047c55a053c14d8324266363fc7ad7fae33fa 100644
(file)
--- a/
sdk/go/keepclient/collectionreader_test.go
+++ b/
sdk/go/keepclient/collectionreader_test.go
@@
-36,7
+36,7
@@
func (s *CollectionReaderUnit) SetUpTest(c *check.C) {
s.handler = SuccessHandler{
disk: make(map[string][]byte),
lock: make(chan struct{}, 1),
s.handler = SuccessHandler{
disk: make(map[string][]byte),
lock: make(chan struct{}, 1),
- ops: new(int),
+ ops:
new(int),
}
localRoots := make(map[string]string)
for i, k := range RunSomeFakeKeepServers(s.handler, 4) {
}
localRoots := make(map[string]string)
for i, k := range RunSomeFakeKeepServers(s.handler, 4) {
@@
-47,8
+47,8
@@
func (s *CollectionReaderUnit) SetUpTest(c *check.C) {
type SuccessHandler struct {
disk map[string][]byte
type SuccessHandler struct {
disk map[string][]byte
- lock chan struct{}
// channel with buffer==1: full when an operation is in progress.
- ops *int
// number of operations completed
+ lock chan struct{} // channel with buffer==1: full when an operation is in progress.
+ ops *int // number of operations completed
}
func (h SuccessHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
}
func (h SuccessHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
@@
-65,7
+65,7
@@
func (h SuccessHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
if h.ops != nil {
(*h.ops)++
}
if h.ops != nil {
(*h.ops)++
}
- <-
h.lock
+ <-h.lock
resp.Write([]byte(pdh))
case "GET":
pdh := req.URL.Path[1:]
resp.Write([]byte(pdh))
case "GET":
pdh := req.URL.Path[1:]
@@
-74,7
+74,7
@@
func (h SuccessHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
if h.ops != nil {
(*h.ops)++
}
if h.ops != nil {
(*h.ops)++
}
- <-
h.lock
+ <-h.lock
if !ok {
resp.WriteHeader(http.StatusNotFound)
} else {
if !ok {
resp.WriteHeader(http.StatusNotFound)
} else {
@@
-192,7
+192,7
@@
func (s *CollectionReaderUnit) TestCollectionReaderCloseEarly(c *check.C) {
}()
err = rdr.Close()
c.Assert(err, check.IsNil)
}()
err = rdr.Close()
c.Assert(err, check.IsNil)
- c.Assert(rdr.Error(), check.IsNil)
+ c.Assert(rdr.
(*cfReader).
Error(), check.IsNil)
// Release the stub server's lock. The first GET operation will proceed.
<-s.handler.lock
// Release the stub server's lock. The first GET operation will proceed.
<-s.handler.lock
@@
-202,8
+202,8
@@
func (s *CollectionReaderUnit) TestCollectionReaderCloseEarly(c *check.C) {
<-firstReadDone
// doGet() should close toRead before sending any more bufs to it.
<-firstReadDone
// doGet() should close toRead before sending any more bufs to it.
- if what, ok := <-rdr.toRead; ok {
- c.Errorf("Got %q, expected toRead to be closed",
string(what)
)
+ if what, ok := <-rdr.
(*cfReader).
toRead; ok {
+ c.Errorf("Got %q, expected toRead to be closed",
what
)
}
// Stub should have handled exactly one GET request.
}
// Stub should have handled exactly one GET request.
@@
-217,7
+217,7
@@
func (s *CollectionReaderUnit) TestCollectionReaderDataError(c *check.C) {
c.Check(err, check.IsNil)
for i := 0; i < 2; i++ {
_, err = io.ReadFull(rdr, buf)
c.Check(err, check.IsNil)
for i := 0; i < 2; i++ {
_, err = io.ReadFull(rdr, buf)
- c.Check(err, check.Not
(check.IsNil)
)
+ c.Check(err, check.Not
Nil
)
c.Check(err, check.Not(check.Equals), io.EOF)
}
}
c.Check(err, check.Not(check.Equals), io.EOF)
}
}