From 09c49b80909af00c040d53efa9923085560274db Mon Sep 17 00:00:00 2001 From: Tim Chan Date: Fri, 23 Aug 2024 14:35:55 -0700 Subject: [PATCH] Fixed lint error for otel collector v0.106.1 AND increased duration for TestTacacsLocal unreachable test --- plugins/inputs/tacacs/tacacs_test.go | 2 +- plugins/parsers/parquet/parser.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/tacacs/tacacs_test.go b/plugins/inputs/tacacs/tacacs_test.go index 9b808fdd065d1..ef77a6cb93f56 100644 --- a/plugins/inputs/tacacs/tacacs_test.go +++ b/plugins/inputs/tacacs/tacacs_test.go @@ -192,7 +192,7 @@ func TestTacacsLocal(t *testing.T) { }, { name: "unreachable", - testingTimeout: config.Duration(time.Nanosecond * 1000), + testingTimeout: config.Duration(time.Second * 2), serverToTest: []string{"unreachable.test:49"}, usedUsername: config.NewSecret([]byte(`testusername`)), usedPassword: config.NewSecret([]byte(`testpassword`)), diff --git a/plugins/parsers/parquet/parser.go b/plugins/parsers/parquet/parser.go index 4ee048e1ea98b..11f762c67af4d 100644 --- a/plugins/parsers/parquet/parser.go +++ b/plugins/parsers/parquet/parser.go @@ -57,10 +57,11 @@ func (p *Parser) Parse(buf []byte) ([]telegraf.Metric, error) { for i := 0; i < parquetReader.NumRowGroups(); i++ { rowGroup := parquetReader.RowGroup(i) scanners := make([]*columnParser, metadata.Schema.NumColumns()) - for colIndex := range metadata.Schema.NumColumns() { + numCols := metadata.Schema.NumColumns() + for colIndex := 0; colIndex < numCols; colIndex++ { col, err := rowGroup.Column(colIndex) if err != nil { - return nil, fmt.Errorf("unable to fetch column %q: %w", colIndex, err) + return nil, fmt.Errorf("unable to fetch column %d: %w", colIndex, err) } scanners[colIndex] = newColumnParser(col)