Skip to content

Commit

Permalink
codec: make tests more robust
Browse files Browse the repository at this point in the history
Fixes some build breaks in CI (for Go 1.7, 1.8).
  • Loading branch information
ugorji committed Jun 27, 2018
1 parent edc8f1f commit be38b70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codec/cbor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestCborGoldens(t *testing.T) {
}
bs, err := hex.DecodeString(g.Hex)
if err != nil {
logT(t, "[%v] error hex decoding %s [%v]: %v", i, g.Hex, err)
logT(t, "[%v] error hex decoding %s [%v]: %v", i, g.Hex, g.Hex, err)
failT(t)
}
var v interface{}
Expand Down
6 changes: 4 additions & 2 deletions codec/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,10 +1169,12 @@ func testCodecRpcOne(t *testing.T, rr Rpc, h Handle, doRequest bool, exitSleepMs
// }
if atomic.LoadUint64(&serverExitFlag) == 1 {
serverExitChan <- true
conn1.Close()
if conn1 != nil {
conn1.Close()
}
return // exit serverFn goroutine
}
if err1 == nil {
if err1 == nil && conn1 != nil {
sc := rr.ServerCodec(testReadWriteCloser(conn1), h)
srv.ServeCodec(sc)
}
Expand Down

0 comments on commit be38b70

Please sign in to comment.