From 07fc77b850d633ad56258084bd03453873ce3fdc Mon Sep 17 00:00:00 2001 From: Noah Treuhaft Date: Thu, 6 Aug 2020 12:55:04 -0700 Subject: [PATCH] Disable ZNG compression in zio_test.TestRaw (#1067) zio_test.TestRaw is meant to run without ZNG compression but runs with it because boomerang ignores its compress parameter. Fix boomerang to respect that parameter. --- zio/zng_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zio/zng_test.go b/zio/zng_test.go index eae5ca3b70..d1ea50001d 100644 --- a/zio/zng_test.go +++ b/zio/zng_test.go @@ -42,7 +42,11 @@ func boomerang(t *testing.T, logs string, compress bool) { in := []byte(strings.TrimSpace(logs) + "\n") tzngSrc := tzngio.NewReader(bytes.NewReader(in), resolver.NewContext()) var rawzng Output - rawDst := zngio.NewWriter(&rawzng, zio.WriterFlags{ZngLZ4BlockSize: zio.DefaultZngLZ4BlockSize}) + var zngLZ4BlockSize int + if compress { + zngLZ4BlockSize = zio.DefaultZngLZ4BlockSize + } + rawDst := zngio.NewWriter(&rawzng, zio.WriterFlags{ZngLZ4BlockSize: zngLZ4BlockSize}) require.NoError(t, zbuf.Copy(rawDst, tzngSrc)) require.NoError(t, rawDst.Flush())