Skip to content

Commit b7686a5

Browse files
committed
Reduce timeout for unit tests.
1 parent 0704bcb commit b7686a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ lint: install-golangci-lint simple-lint
199199
${LINTER} run ./...
200200

201201
test:
202-
CGO_ENABLED=0 go test -timeout 15m -coverprofile coverage.txt -failfast ./...
202+
CGO_ENABLED=0 go test -timeout 10m -parallel 4 -coverprofile coverage.txt -failfast ./...
203203

204204
# List of existing packages with data races
205205
# TODO: Fix each
@@ -214,7 +214,7 @@ PKG_WITH_DATA_RACE += plugins/outputs/cloudwatch$$
214214
PKG_WITH_DATA_RACE += plugins/processors/ec2tagger
215215
PKG_WITH_DATA_RACE_PATTERN := $(shell echo '$(PKG_WITH_DATA_RACE)' | tr ' ' '|')
216216
test-data-race:
217-
CGO_ENABLED=1 go test -timeout 15m -race -parallel 4 $(shell go list ./... | grep -v -E '$(PKG_WITH_DATA_RACE_PATTERN)')
217+
CGO_ENABLED=1 go test -timeout 10m -race -parallel 4 $(shell go list ./... | grep -v -E '$(PKG_WITH_DATA_RACE_PATTERN)')
218218

219219
clean::
220220
rm -rf release/ build/

plugins/inputs/logfile/tail/tail_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ func TestConcurrentLinePoolAccess(t *testing.T) {
377377
wg.Add(1)
378378
go func() {
379379
defer wg.Done()
380+
defer close(linesChan)
380381
for i := 0; i < numLines; i++ {
381382
select {
382383
case line := <-tail.Lines:
@@ -386,7 +387,6 @@ func TestConcurrentLinePoolAccess(t *testing.T) {
386387
return
387388
}
388389
}
389-
close(linesChan)
390390
}()
391391

392392
numWorkers := 5

0 commit comments

Comments
 (0)