Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cover: inconsistent NumStmt error #30746

Closed
sgtsquiggs opened this issue Mar 11, 2019 · 9 comments
Closed

cmd/cover: inconsistent NumStmt error #30746

sgtsquiggs opened this issue Mar 11, 2019 · 9 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@sgtsquiggs
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.11.5 linux/amd64

Does this issue reproduce with the latest release?

Yes, also occurs for go version go1.12 linux/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/spare/local/mcrenshaw/gocache"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/spare/local/mcrenshaw/go-workspace"
GOPROXY=""
GORACE=""
GOROOT="/spare/local/mcrenshaw/go"
GOTMPDIR=""
GOTOOLDIR="/spare/local/mcrenshaw/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build155345880=/tmp/go-build -gno-record-gcc-switches"

What did you do?

PATH=$GOROOT/bin:$PATH
GOPATH=$(mktemp -d)
mkdir -p $GOPATH/bin $GOPATH/src
go get -d -u github.com/golang/dep
cd $GOPATH/src/github.com/golang/dep
DEP_LATEST=$(git describe --abbrev=0 --tags)
git checkout $DEP_LATEST
go install -ldflags="-X main.version=$DEP_LATEST" ./cmd/dep
git checkout master
mkdir -p $GOPATH/src/github.com/influxdata/telegraf
cd $GOPATH/src/github.com/influxdata/telegraf
git clone https://github.com/influxdata/telegraf.git .
git checkout 1.10.0
dep ensure -vendor-only
go test -timeout 120s -short -covermode atomic -cover -coverprofile profile.out ./...
go tool cover -func=profile.out

What did you expect to see?

go tool cover output without error

What did you see instead?

cover: inconsistent NumStmt: changed from 1 to 2

Related?

This seems to be the same as issue #27350, which is marked as merged/closed. The code for which cover fails on are in (https://github.com/influxdata/telegraf/blob/1.10.0/plugins/parsers/influx/machine.go).

@ianlancetaylor
Copy link
Member

I agree that this seems to be the same as #27350, which is fixed in 1.12 but not in 1.11.5. You should either update to 1.12 or run gofmt on the file in question.

@sgtsquiggs
Copy link
Author

Using 1.12 without gofmt resulted in same error. Using 1.12 and running go fmt ./... prior to go test resulted in similar error:
cover: inconsistent NumStmt: changed from 3 to 1

@mvdan
Copy link
Member

mvdan commented Mar 11, 2019

Reopening, just in case it's not a duplicate.

@mvdan mvdan reopened this Mar 11, 2019
@ianlancetaylor
Copy link
Member

I went through the steps you outlined using Go 1.12 and I could not recreate the problem. Can you double check that you were using Go 1.12 for all steps? Thanks.

@robpike
Copy link
Contributor

robpike commented Mar 12, 2019

I tried as well and could not reproduce the problem with Go 1.12.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 12, 2019
@sgtsquiggs
Copy link
Author

Somehow I am able to reproduce this every time.

Here is my current test script:

test.sh

#!/bin/env bash
set -x

WORKDIR=/spare/local/tmp

# go
cd $WORKDIR
curl -sO https://dl.google.com/go/go1.12.linux-amd64.tar.gz
tar xzf go1.12.linux-amd64.tar.gz

# env
GOROOT=$WORKDIR/go
GOCACHE=$WORKDIR/gocache
GOPATH=$(mktemp -d -p $WORKDIR)
mkdir -p $GOPATH/bin $GOPATH/src $GOPATH/pkg
PATH=$GOROOT/bin:$GOPATH/bin:$PATH

# sanity check
go version
go env

# dep
go get -d -u github.com/golang/dep
cd $GOPATH/src/github.com/golang/dep
DEP_LATEST=$(git describe --abbrev=0 --tags)
git checkout $DEP_LATEST
go install -ldflags="-X main.version=$DEP_LATEST" ./cmd/dep
git checkout master

# telegraf
mkdir -p $GOPATH/src/github.com/influxdata/telegraf
cd $GOPATH/src/github.com/influxdata/telegraf
git clone https://github.com/influxdata/telegraf.git .
git checkout 1.10.0
dep ensure -vendor-only

# tests
go test -timeout 120s -short -covermode atomic -cover -coverprofile profile.out ./...

# cover sanity check
go tool cover -V
go tool cover -func=profile.out


Here is the output:

./test.sh 2>&1 | tee test.out

+ WORKDIR=/spare/local/tmp
+ cd /spare/local/tmp
+ curl -sO https://dl.google.com/go/go1.12.linux-amd64.tar.gz
+ tar xzf go1.12.linux-amd64.tar.gz
+ GOROOT=/spare/local/tmp/go
+ GOCACHE=/spare/local/tmp/gocache
++ mktemp -d -p /spare/local/tmp
+ GOPATH=/spare/local/tmp/tmp.wGg57hYY3u
+ mkdir -p /spare/local/tmp/tmp.wGg57hYY3u/bin /spare/local/tmp/tmp.wGg57hYY3u/src /spare/local/tmp/tmp.wGg57hYY3u/pkg
+ PATH=/spare/local/tmp/go/bin:/spare/local/tmp/tmp.wGg57hYY3u/bin:/spare/local/mcrenshaw/go1.12/go/bin:/spare/local/mcrenshaw/go1.12/tmp.b1upnMQzsu/bin:/spare/local/mcrenshaw/bin:/spare/local/mcrenshaw/sbin:/apps/infrafs1/mcrenshaw/.pyenv/shims:/spare/local/mcrenshaw/pyenv/bin:/spare/local/mcrenshaw/node/bin:/spare/local/mcrenshaw/go-workspace/bin:/spare/local/mcrenshaw/go/bin:/usr/local/bin:/usr/local/sbin:/apps/infrafs1/mcrenshaw/bin:/apps/infrafs1/mcrenshaw/.local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/var/cfengine/bin
+ go version
go version go1.12 linux/amd64
+ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/spare/local/tmp/gocache"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/spare/local/tmp/tmp.wGg57hYY3u"
GOPROXY=""
GORACE=""
GOROOT="/spare/local/tmp/go"
GOTMPDIR=""
GOTOOLDIR="/spare/local/tmp/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build205710529=/tmp/go-build -gno-record-gcc-switches"
+ go get -d -u github.com/golang/dep
+ cd /spare/local/tmp/tmp.wGg57hYY3u/src/github.com/golang/dep
++ git describe --abbrev=0 --tags
+ DEP_LATEST=v0.5.1
+ git checkout v0.5.1
Note: checking out 'v0.5.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at faa61893 CHANGELOG: prepare for 0.5.1 release
+ go install '-ldflags=-X main.version=v0.5.1' ./cmd/dep
+ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
+ mkdir -p /spare/local/tmp/tmp.wGg57hYY3u/src/github.com/influxdata/telegraf
+ cd /spare/local/tmp/tmp.wGg57hYY3u/src/github.com/influxdata/telegraf
+ git clone https://github.com/influxdata/telegraf.git .
Cloning into '.'...
+ git checkout 1.10.0
Note: checking out '1.10.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at fe33ee89 Telegraf 1.10.0
+ dep ensure -vendor-only
+ go test -timeout 120s -short -covermode atomic -cover -coverprofile profile.out ./...
?   	github.com/influxdata/telegraf	[no test files]
ok  	github.com/influxdata/telegraf/agent	0.146s	coverage: 8.4% of statements
?   	github.com/influxdata/telegraf/cmd/telegraf	[no test files]
ok  	github.com/influxdata/telegraf/filter	0.013s	coverage: 88.6% of statements
ok  	github.com/influxdata/telegraf/internal	0.048s	coverage: 50.3% of statements
ok  	github.com/influxdata/telegraf/internal/config	0.042s	coverage: 28.9% of statements
?   	github.com/influxdata/telegraf/internal/config/aws	[no test files]
ok  	github.com/influxdata/telegraf/internal/globpath	0.026s	coverage: 72.7% of statements
?   	github.com/influxdata/telegraf/internal/limiter	[no test files]
ok  	github.com/influxdata/telegraf/internal/models	0.026s	coverage: 84.1% of statements
ok  	github.com/influxdata/telegraf/internal/templating	0.043s	coverage: 65.3% of statements
ok  	github.com/influxdata/telegraf/internal/tls	0.016s	coverage: 97.9% of statements
ok  	github.com/influxdata/telegraf/logger	0.045s	coverage: 84.2% of statements
ok  	github.com/influxdata/telegraf/metric	0.006s	coverage: 63.7% of statements
?   	github.com/influxdata/telegraf/plugins/aggregators	[no test files]
?   	github.com/influxdata/telegraf/plugins/aggregators/all	[no test files]
ok  	github.com/influxdata/telegraf/plugins/aggregators/basicstats	0.018s	coverage: 95.6% of statements
ok  	github.com/influxdata/telegraf/plugins/aggregators/histogram	0.021s	coverage: 88.5% of statements
ok  	github.com/influxdata/telegraf/plugins/aggregators/minmax	0.008s	coverage: 92.3% of statements
ok  	github.com/influxdata/telegraf/plugins/aggregators/valuecounter	0.024s	coverage: 72.7% of statements
?   	github.com/influxdata/telegraf/plugins/inputs	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/activemq	0.023s	coverage: 47.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/aerospike	0.013s	coverage: 9.0% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/all	[no test files]
?   	github.com/influxdata/telegraf/plugins/inputs/amqp_consumer	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/apache	0.013s	coverage: 69.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/aurora	0.025s	coverage: 85.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/bcache	0.008s	coverage: 85.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/beanstalkd	0.068s	coverage: 80.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/bond	0.037s	coverage: 56.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/burrow	0.060s	coverage: 80.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cassandra	0.035s	coverage: 82.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/ceph	0.058s	coverage: 58.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cgroup	0.049s	coverage: 77.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/chrony	0.061s	coverage: 82.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cloud_pubsub	1.043s	coverage: 53.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cloud_pubsub_push	2.035s	coverage: 52.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cloudwatch	0.056s	coverage: 84.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/conntrack	0.027s	coverage: 78.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/consul	0.026s	coverage: 42.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/couchbase	0.021s	coverage: 51.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/couchdb	0.046s	coverage: 75.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/cpu	0.032s	coverage: 90.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/dcos	0.028s	coverage: 63.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/disk	0.067s	coverage: 77.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/diskio	0.022s	coverage: 86.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/disque	0.034s	coverage: 1.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/dmcache	0.027s	coverage: 76.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/dns_query	0.006s	coverage: 35.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/docker	0.079s	coverage: 82.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/dovecot	0.029s	coverage: 1.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/elasticsearch	0.027s	coverage: 65.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/exec	0.068s	coverage: 45.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/fail2ban	0.144s	coverage: 79.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/fibaro	0.057s	coverage: 84.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/file	0.084s	coverage: 70.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/filecount	0.024s	coverage: 84.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/filestat	0.045s	coverage: 81.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/fluentd	0.039s	coverage: 74.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/graylog	0.063s	coverage: 82.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/haproxy	0.058s	coverage: 84.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/hddtemp	0.068s	coverage: 68.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/hddtemp/go-hddtemp	0.048s	coverage: 94.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/http	0.068s	coverage: 79.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/http_listener_v2	0.568s	coverage: 77.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/http_response	0.060s	coverage: 79.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/httpjson	0.052s	coverage: 85.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/icinga2	0.036s	coverage: 31.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/influxdb	0.058s	coverage: 83.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/influxdb_listener	0.556s	coverage: 89.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/internal	0.031s	coverage: 83.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/interrupts	0.072s	coverage: 72.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/ipmi_sensor	0.129s	coverage: 82.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/ipset	0.014s	coverage: 52.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/iptables	0.031s	coverage: 58.7% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/ipvs	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/jenkins	0.045s	coverage: 72.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/jolokia	0.013s	coverage: 62.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/jolokia2	0.064s	coverage: 90.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/jti_openconfig_telemetry	8.071s	coverage: 68.6% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/jti_openconfig_telemetry/auth	[no test files]
?   	github.com/influxdata/telegraf/plugins/inputs/jti_openconfig_telemetry/oc	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/kafka_consumer	0.028s	coverage: 26.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kafka_consumer_legacy	0.041s	coverage: 25.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kapacitor	0.036s	coverage: 85.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kernel	0.024s	coverage: 79.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kernel_vmstat	0.009s	coverage: 80.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kibana	0.014s	coverage: 65.6% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/kinesis_consumer	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/kube_inventory	0.008s	coverage: 37.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/kubernetes	0.048s	coverage: 84.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/leofs	2.873s	coverage: 73.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/linux_sysctl_fs	0.021s	coverage: 73.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/logparser	0.096s	coverage: 81.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/lustre2	0.023s	coverage: 69.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mailchimp	0.050s	coverage: 72.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mcrouter	0.012s	coverage: 36.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mem	0.015s	coverage: 63.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/memcached	0.019s	coverage: 19.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mesos	0.033s	coverage: 73.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/minecraft	0.028s	coverage: 61.6% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/minecraft/internal/rcon	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/mongodb	0.036s	coverage: 9.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mqtt_consumer	0.050s	coverage: 26.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/multifile	0.033s	coverage: 83.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/mysql	0.048s	coverage: 3.9% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/mysql/v1	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/nats	0.055s	coverage: 75.0% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/nats_consumer	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/neptune_apex	0.039s	coverage: 94.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/net	0.046s	coverage: 71.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/net_response	0.117s	coverage: 92.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nginx	0.057s	coverage: 72.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nginx_plus	0.045s	coverage: 81.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nginx_plus_api	0.075s	coverage: 67.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nginx_upstream_check	0.059s	coverage: 76.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nginx_vts	0.049s	coverage: 79.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nsq	0.031s	coverage: 82.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nsq_consumer	30.042s	coverage: 65.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nstat	0.042s	coverage: 36.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/ntpq	0.031s	coverage: 75.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/nvidia_smi	0.026s	coverage: 44.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/openldap	0.012s	coverage: 25.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/opensmtpd	0.022s	coverage: 52.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/passenger	0.108s	coverage: 92.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/pf	0.025s	coverage: 73.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/pgbouncer	0.028s	coverage: 1.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/phpfpm	0.023s	coverage: 79.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/ping	0.030s	coverage: 79.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/postfix	0.058s	coverage: 62.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/postgresql	0.014s	coverage: 0.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible	0.063s	coverage: 33.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/powerdns	0.037s	coverage: 80.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/processes	0.244s	coverage: 63.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/procstat	0.078s	coverage: 62.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/prometheus	0.030s	coverage: 61.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/puppetagent	0.025s	coverage: 76.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/rabbitmq	0.041s	coverage: 74.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/raindrops	0.036s	coverage: 76.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/redis	0.019s	coverage: 52.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/rethinkdb	0.046s	coverage: 6.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/riak	0.066s	coverage: 71.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/salesforce	0.050s	coverage: 37.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/sensors	0.089s	coverage: 87.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/smart	0.187s	coverage: 89.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/snmp	0.580s	coverage: 81.2% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/snmp_legacy	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/socket_listener	0.083s	coverage: 71.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/solr	0.102s	coverage: 88.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/sqlserver	1.186s	coverage: 1.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/stackdriver	0.021s	coverage: 75.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/statsd	0.957s	coverage: 83.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/swap	0.024s	coverage: 69.2% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/syslog	0.257s	coverage: 87.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/sysstat	0.045s	coverage: 83.0% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/system	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/tail	0.009s	coverage: 81.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/tcp_listener	0.776s	coverage: 88.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/teamspeak	0.052s	coverage: 66.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/temp	0.022s	coverage: 57.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/tengine	0.019s	coverage: 70.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/tomcat	0.049s	coverage: 80.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/trig	0.021s	coverage: 76.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/twemproxy	0.015s	coverage: 89.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/udp_listener	2.306s	coverage: 83.8% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/unbound	0.049s	coverage: 50.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/varnish	0.042s	coverage: 57.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/vsphere	2.673s	coverage: 81.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks	0.048s	coverage: 37.5% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/filestack	0.020s	coverage: 70.6% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/github	0.017s	coverage: 79.0% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/mandrill	0.032s	coverage: 58.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/papertrail	0.021s	coverage: 89.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/particle	0.032s	coverage: 66.7% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/webhooks/rollbar	0.025s	coverage: 76.5% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/win_perf_counters	[no test files]
?   	github.com/influxdata/telegraf/plugins/inputs/win_services	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/wireless	0.042s	coverage: 34.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/x509_cert	0.009s	coverage: 59.4% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/zfs	0.053s	coverage: 85.3% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/zipkin	0.038s	coverage: 65.7% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/zipkin/cmd/stress_test_write	[no test files]
?   	github.com/influxdata/telegraf/plugins/inputs/zipkin/cmd/thrift_serialize	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/zipkin/codec	0.013s	coverage: 93.9% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/zipkin/codec/jsonV1	0.038s	coverage: 95.1% of statements
ok  	github.com/influxdata/telegraf/plugins/inputs/zipkin/codec/thrift	0.016s	coverage: 31.5% of statements
?   	github.com/influxdata/telegraf/plugins/inputs/zipkin/trace	[no test files]
ok  	github.com/influxdata/telegraf/plugins/inputs/zookeeper	0.047s	coverage: 1.5% of statements
?   	github.com/influxdata/telegraf/plugins/outputs	[no test files]
?   	github.com/influxdata/telegraf/plugins/outputs/all	[no test files]
ok  	github.com/influxdata/telegraf/plugins/outputs/amon	0.025s	coverage: 25.0% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/amqp	0.051s	coverage: 24.1% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/application_insights	0.073s	coverage: 86.7% of statements
?   	github.com/influxdata/telegraf/plugins/outputs/application_insights/mocks	[no test files]
ok  	github.com/influxdata/telegraf/plugins/outputs/azure_monitor	0.035s	coverage: 69.3% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/cloud_pubsub	0.044s	coverage: 68.4% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/cloudwatch	0.021s	coverage: 73.6% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/cratedb	0.049s	coverage: 61.3% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/datadog	0.024s	coverage: 81.3% of statements
?   	github.com/influxdata/telegraf/plugins/outputs/discard	[no test files]
ok  	github.com/influxdata/telegraf/plugins/outputs/elasticsearch	0.044s	coverage: 22.9% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/file	0.053s	coverage: 73.0% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/graphite	0.107s	coverage: 84.4% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/graylog	0.059s	coverage: 62.1% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/http	5.047s	coverage: 84.7% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/influxdb	0.049s	coverage: 79.5% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/influxdb_v2	0.030s	coverage: 45.0% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/instrumental	0.028s	coverage: 75.8% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/kafka	0.031s	coverage: 6.9% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/kinesis	0.026s	coverage: 26.6% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/librato	0.031s	coverage: 72.1% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/mqtt	0.017s	coverage: 1.2% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/nats	0.011s	coverage: 3.1% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/nsq	0.021s	coverage: 4.3% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/opentsdb	0.010s	coverage: 10.5% of statements
--- FAIL: TestWorksWithTLS (0.02s)
    require.go:248: 
        	Error Trace:	prometheus_client_tls_test.go:60
        	Error:      	An error is expected but got nil.
        	Test:       	TestWorksWithTLS
FAIL
coverage: 69.5% of statements
FAIL	github.com/influxdata/telegraf/plugins/outputs/prometheus_client	0.034s
ok  	github.com/influxdata/telegraf/plugins/outputs/riemann	0.005s	coverage: 52.1% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/riemann_legacy	0.005s	coverage: 1.6% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/socket_writer	0.025s	coverage: 59.6% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/stackdriver	0.025s	coverage: 75.8% of statements
ok  	github.com/influxdata/telegraf/plugins/outputs/wavefront	0.029s	coverage: 62.0% of statements
?   	github.com/influxdata/telegraf/plugins/parsers	[no test files]
ok  	github.com/influxdata/telegraf/plugins/parsers/collectd	0.005s	coverage: 58.2% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/csv	0.018s	coverage: 83.6% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/dropwizard	0.007s	coverage: 82.8% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/graphite	0.006s	coverage: 49.6% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/grok	0.267s	coverage: 92.8% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/influx	0.028s	coverage: 4.3% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/json	0.028s	coverage: 73.9% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/logfmt	0.025s	coverage: 79.5% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/nagios	0.013s	coverage: 85.4% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/value	0.013s	coverage: 88.9% of statements
ok  	github.com/influxdata/telegraf/plugins/parsers/wavefront	0.049s	coverage: 88.1% of statements
?   	github.com/influxdata/telegraf/plugins/processors	[no test files]
?   	github.com/influxdata/telegraf/plugins/processors/all	[no test files]
ok  	github.com/influxdata/telegraf/plugins/processors/converter	0.029s	coverage: 89.2% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/enum	0.024s	coverage: 88.5% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/override	0.019s	coverage: 78.6% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/parser	0.034s	coverage: 85.4% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/printer	0.032s	coverage: 10.0% of statements [no tests to run]
ok  	github.com/influxdata/telegraf/plugins/processors/regex	0.004s	coverage: 88.5% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/rename	0.017s	coverage: 82.6% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/strings	0.021s	coverage: 91.8% of statements
ok  	github.com/influxdata/telegraf/plugins/processors/topk	17.029s	coverage: 86.3% of statements
?   	github.com/influxdata/telegraf/plugins/serializers	[no test files]
ok  	github.com/influxdata/telegraf/plugins/serializers/carbon2	0.018s	coverage: 100.0% of statements
ok  	github.com/influxdata/telegraf/plugins/serializers/graphite	0.026s	coverage: 91.1% of statements
ok  	github.com/influxdata/telegraf/plugins/serializers/influx	0.011s	coverage: 91.9% of statements
ok  	github.com/influxdata/telegraf/plugins/serializers/json	0.004s	coverage: 93.3% of statements
ok  	github.com/influxdata/telegraf/plugins/serializers/nowmetric	0.030s	coverage: 79.1% of statements
ok  	github.com/influxdata/telegraf/plugins/serializers/splunkmetric	0.009s	coverage: 89.1% of statements
ok  	github.com/influxdata/telegraf/selfstat	0.031s	coverage: 97.6% of statements
ok  	github.com/influxdata/telegraf/testutil	0.003s	coverage: 7.8% of statements
+ go tool cover -V
cover version go1.12
+ go tool cover -func=profile.out
cover: inconsistent NumStmt: changed from 1 to 2

@ianlancetaylor
Copy link
Member

Thanks, with that I was able to recreate the problem.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/167257 mentions this issue: cmd/cover: don't assume duplicate positions are in order

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/167740 mentions this issue: cmd/cover: add go.mod file in lineDupDir

gopherbot pushed a commit that referenced this issue Mar 15, 2019
This fixes TestFuncWithDuplicateLines (introduced in CL 167257)
in module mode.

Updates #30746
Updates #30228

Change-Id: I7b3e7192ae23f855c373e881389874ff6ffd49ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/167740
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@golang golang locked and limited conversation to collaborators Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants