Test failure error:beats

Heloo,

i am running test suit on beat version 6.4.1 and getting some error.

Steps:

  1. Clone beats source code from git
  2. Download and set GO lang and GOPATH.
  3. Run make testsuite command.

o/p:

command [go test -cover -coverprofile /tmp/gotestcover-206680631 github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata]: exit status 2
# github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata
/usr/local/go/src/github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata/kubernetes.go:106: Debug call has arguments but no formatting directives
/usr/local/go/src/github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata/kubernetes.go:115: Err format %t has arg &kubernetes.Pod{} of wrong type *github.com/elastic/beats/vendor/github.com/ericchiang/k8s/apis/core/v1.Pod
FAIL	github.com/elastic/beats/libbeat/processors/add_kubernetes_metadata [build failed]
?   	github.com/elastic/beats/libbeat/publisher/queue	[no test files]
?   	github.com/elastic/beats/libbeat/publisher/queue/queuetest	[no test files]
?   	github.com/elastic/beats/libbeat/service	[no test files]
ok  	github.com/elastic/beats/libbeat/publisher/testing	0.007s	coverage: 53.3% of statements
ok  	github.com/elastic/beats/libbeat/publisher/pipeline	0.014s	coverage: 6.1% of statements
ok  	github.com/elastic/beats/libbeat/template	0.007s	coverage: 54.8% of statements
ok  	github.com/elastic/beats/libbeat/testing	0.007s	coverage: 87.3% of statements
?   	github.com/elastic/beats/libbeat/tests/compose	[no test files]
?   	github.com/elastic/beats/libbeat/version	[no test files]
ok  	github.com/elastic/beats/libbeat/testing/mapvaltest	0.009s	coverage: 100.0% of statements
?   	github.com/elastic/beats/libbeat/tests/docker	[no test files]
ok  	github.com/elastic/beats/libbeat/publisher/queue/memqueue	1.883s	coverage: 76.8% of statements
ok  	github.com/elastic/beats/libbeat/outputs/logstash	10.158s	coverage: 73.0% of statements
ok  	github.com/elastic/beats/libbeat/publisher/queue/spool	4.888s	coverage: 61.9% of statements
test failed
make[2]: *** [unit-tests] Error 1
make[2]: Leaving directory `/root/gocode/src/github.com/elastic/beats/libbeat'
make[1]: *** [testsuite] Error 2
make[1]: Leaving directory `/root/gocode/src/github.com/elastic/beats/libbeat'
make: *** [testsuite] Error 1

Test suite is failed.

If i run the command as below:
make testsuite -i

its ignoring the failed test and going for docker-compose file and giving another error as below.
o/p:
ignored as previous failed:

ok  	github.com/elastic/beats/libbeat/outputs/logstash	10.116s	coverage: 73.0% of statements
ok  	github.com/elastic/beats/libbeat/publisher/queue/spool	6.633s	coverage: 61.1% of statements
test failed
make[2]: [unit-tests] Error 1 (ignored)
make[2]: Leaving directory `/root/gocode/src/github.com/elastic/beats/libbeat'
if [ false  = true ]; then \
	 make stress-tests; \
fi
# Setups environment if TEST_ENVIRONMENT is set to true
# Only runs integration tests with test environment
if [ true = true ]; then \
	 make integration-tests-environment; \
fi

Docker-compose error:

 ---> ed94d92da038
Removing intermediate container c0ee3dbc03cf
Step 15/31 : RUN /download.sh $DOWNLOAD_URL $ELASTIC_VERSION $CACHE_BUST && rm /download.sh
 ---> Running in 55efc8cb0e36

Removing intermediate container 55efc8cb0e36
ERROR: Service 'elasticsearch' failed to build: The command '/bin/sh -c /download.sh $DOWNLOAD_URL $ELASTIC_VERSION $CACHE_BUST && rm /download.sh' returned a non-zero code: 28
make[2]: [build-image] Error 1 (ignored)

anyone help??

Hi
can anyone help on this???

Is there a specific reason you run on 6.4 and not 7.1 for example? Seeing some of the errors it could be that you use a different Golang version then was used for developing 6.4?

Hi @ruflin,

Thank you for your reply!

Actually we are using 6.4. for production environment and there is no plan to upgrade the same.

We have some requirement to run test suite on this version and i'm using go version as mentioned in the doc and getting errors.

# git branch
* 6.4
  master
# go version
go version go1.10.3 linux/amd64

Error:

Step 15/31 : RUN /download.sh $DOWNLOAD_URL $ELASTIC_VERSION $CACHE_BUST && rm /download.sh
 ---> Running in e27cd3602fd4

Removing intermediate container e27cd3602fd4
ERROR: Service 'elasticsearch' failed to build: The command '/bin/sh -c /download.sh $DOWNLOAD_URL $ELASTIC_VERSION $CACHE_BUST && rm /download.sh' returned a non-zero code: 28
make[2]: *** [build-image] Error 1
make[2]: Leaving directory `/usr/local/go/work/src/github.com/elastic/beats/libbeat'
make[1]: *** [testsuite] Error 2
make[1]: Leaving directory `/usr/local/go/work/src/github.com/elastic/beats/libbeat'
make: *** [testsuite] Error 1

Please help me to resolve this problem.

Hi @ruflin,

one more thing i observed related to this.

In 6.4.1: https://github.com/elastic/beats/tree/v6.4.1/testing/environments/docker/elasticsearch as elasticsearch folder is available.
in 6.5.1:
https://github.com/elastic/beats/tree/v6.5.1/testing/environments/docker as elasticsearch folder is not available.

Is there any specific reason to remove this in 6.5.x branch??

Please help???

In 6.5 we switched over to the official docker images for testing which did not require us anymore to have all the correct setup.

Looking at the error it seems for some reason the docker image does not built. It fails on the download step so I assume some link got out of date. The download url is taken from here: https://github.com/elastic/beats/blob/6.4/testing/environments/args.yml#L9 A SNAPSHOT was used for testing and SNAPSHOT are removed after a few days from the storage. That is probably the reason it does not work anymore. I would recommend you to adjust the args.yml file to use a released version, you must also adjust the DOWNLOAD_URL part.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.