rafthttp: fix misprint in readBytesLimit value

and make test path in restricted test environments
release-3.1
Nikita Vetoshkin 2016-09-05 11:06:08 +05:00
parent a66b1e7c60
commit da26e230a0
2 changed files with 7 additions and 1 deletions

View File

@ -43,7 +43,7 @@ type messageDecoder struct {
}
var (
readBytesLimit uint64 = 512 * 1024 // 512 MB
readBytesLimit uint64 = 512 * 1024 * 1024 // 512 MB
ErrExceedSizeLimit = errors.New("rafthttp: error limit exceeded")
)

View File

@ -23,6 +23,12 @@ import (
)
func TestMessage(t *testing.T) {
// Lower readBytesLimit to make test pass in restricted resources environment
originalLimit := readBytesLimit
readBytesLimit = 1000
defer func() {
readBytesLimit = originalLimit
}()
tests := []struct {
msg raftpb.Message
encodeErr error