mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Correctly close generated benchmark archives
Another update to TarSum tests, this patch fixes an issue where the benchmarks were generating archives incorrectly by not closing the tarWriter. Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
parent
92fd49f7ca
commit
385917e22c
1 changed files with 1 additions and 0 deletions
|
@ -132,6 +132,7 @@ func sizedTar(opts sizedOptions) io.Reader {
|
||||||
fh = bytes.NewBuffer([]byte{})
|
fh = bytes.NewBuffer([]byte{})
|
||||||
}
|
}
|
||||||
tarW := tar.NewWriter(fh)
|
tarW := tar.NewWriter(fh)
|
||||||
|
defer tarW.Close()
|
||||||
for i := int64(0); i < opts.num; i++ {
|
for i := int64(0); i < opts.num; i++ {
|
||||||
err := tarW.WriteHeader(&tar.Header{
|
err := tarW.WriteHeader(&tar.Header{
|
||||||
Name: fmt.Sprintf("/testdata%d", i),
|
Name: fmt.Sprintf("/testdata%d", i),
|
||||||
|
|
Loading…
Reference in a new issue