# Uncertainty unit test cases in apm java agent

**URL:** <https://discuss.elastic.co/t/uncertainty-unit-test-cases-in-apm-java-agent/212163>\
**Category:** APM\
**Tags:** java\
**Created:** [December 17, 2019, 12:54pm UTC](https://discuss.elastic.co/t/uncertainty-unit-test-cases-in-apm-java-agent/212163 "2019-12-17T12:54:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yelururao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yelururao/32/53960_2.png) [@yelururao](https://discuss.elastic.co/u/yelururao)\
**Post date:** [December 17, 2019, 12:54pm UTC](https://discuss.elastic.co/t/uncertainty-unit-test-cases-in-apm-java-agent/212163/1 "2019-12-17T12:54:30Z")

</div>

Hi Team,

i enable the unit test cases for java agent 1.10.0 version, but there is uncertinity sometime some test pass and some time same test fails.

**Kibana version** :

**Elasticsearch version** :

**APM Server version** :

**APM Agent language and version** : Java agent 1.10.0

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

**Fresh install or upgraded from other version?**

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**:

**Provide logs and/or server output (if relevant)**:  
Failed tests:  
JBossIT\>AbstractServletContainerIntegrationTest.testAllScenarios:244-\>AbstractServletContainerIntegrationTest.getAllReported:312  
Expected size:\<2\> but was:\<1\> in:  
\<[{"timestamp":1576579175880010,"name":"GET /hello-world.jsp","id":"a20b18b7c5e2de2e","trace\_id":"59744ed704b1e76e39cc842c2ec0b5d6","parent\_id":"ca0e8378307d7fd3","type":"request","duration":84.776,"result":"HTTP 2xx","context":{"service":{"name":"Simple Web App"},"request":{"method":"GET","headers":{"elastic-apm-traceparent":"00-59744ed704b1e76e39cc842c2ec0b5d6-ca0e8378307d7fd3-01","cache-control":"no-cache","pragma":"no-cache","user-agent":"Java/1.8.0\_232","host":"172.19.0.3:8080","accept":"text/html, image/gif, image/jpeg, \*; q=.2, _/_; q=.2","connection":"keep-alive"},"url":{"full":"[http://172.19.0.3:8080/simple-webapp/hello-world.jsp","hostname":"172.19.0.3","port":"8080","pathname":"/simple-webapp/hello-world.jsp","protocol":"http"},"socket":{"encrypted":false,"remote\_address":"172.19.0.3"},"http\_version":"1.1"},"response":{"headers":{"X-Powered-By":"JSP/2.2","Set-Cookie":"[REDACTED]"},"finished":true,"headers\_sent":false,"status\_code":200},"tags":{}},"span\_count":{"dropped":0,"started":0},"sampled](http://172.19.0.3:8080/simple-webapp/hello-world.jsp%22,%22hostname%22:%22172.19.0.3%22,%22port%22:%228080%22,%22pathname%22:%22/simple-webapp/hello-world.jsp%22,%22protocol%22:%22http%22%7D,%22socket%22:%7B%22encrypted%22:false,%22remote_address%22:%22172.19.0.3%22%7D,%22http_version%22:%221.1%22%7D,%22response%22:%7B%22headers%22:%7B%22X-Powered-By%22:%22JSP/2.2%22,%22Set-Cookie%22:%22%5BREDACTED%5D%22%7D,%22finished%22:true,%22headers_sent%22:false,%22status_code%22:200%7D,%22tags%22:%7B%7D%7D,%22span_count%22:%7B%22dropped%22:0,%22started%22:0%7D,%22sampled)":true}]\>

Tests run: 27, Failures: 1, Errors: 0, Skipped: 1

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [December 17, 2019, 1:15pm UTC](https://discuss.elastic.co/t/uncertainty-unit-test-cases-in-apm-java-agent/212163/2 "2019-12-17T13:15:29Z")

</div>

Yeah, the integration tests are known to be a bit flaky.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 20, 2020, 9:10am UTC](https://discuss.elastic.co/t/uncertainty-unit-test-cases-in-apm-java-agent/212163/4 "2020-01-20T09:10:26Z")

</div>

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