From: Joe Tsai Date: Wed, 30 Mar 2016 06:34:37 +0000 (-0700) Subject: debug/elf: deflake file_test.go X-Git-Tag: go1.7beta1~1018 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=897dcdb5ecc001fac328c53806f8a1dbf2e8c3fd;p=gostls13.git debug/elf: deflake file_test.go It is valid for io.Reader to return (n, io.EOF) where n is positive. The unit test should not fail if io.EOF is returned when read until the end. Change-Id: I7b918e3cc03db8b90c8aa58f4c0f7806a1d4af7e Reviewed-on: https://go-review.googlesource.com/21307 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/debug/elf/file_test.go b/src/debug/elf/file_test.go index 42caefa4cf..2fe6febb26 100644 --- a/src/debug/elf/file_test.go +++ b/src/debug/elf/file_test.go @@ -688,7 +688,7 @@ func TestCompressedSection(t *testing.T) { if end > int64(len(buf)) { end = int64(len(buf)) } - n, err := sf.Read(buf[pos:end]) + n, err := io.ReadFull(sf, buf[pos:end]) if err != nil { t.Fatal(err) }