# Integration test issues with elasticsearch

**URL:** <https://discuss.elastic.co/t/integration-test-issues-with-elasticsearch/16413>\
**Category:** Elasticsearch\
**Created:** [March 18, 2014, 1:42am UTC](https://discuss.elastic.co/t/integration-test-issues-with-elasticsearch/16413 "2014-03-18T01:42:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slushi](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@slushi](https://discuss.elastic.co/u/slushi)\
**Post date:** [March 18, 2014, 1:42am UTC](https://discuss.elastic.co/t/integration-test-issues-with-elasticsearch/16413/1 "2014-03-18T01:42:35Z")

</div>

I have been getting sporadic failures with my elastic search based  
integration tests on 0.90.11. The tests seem to work on and off, when they  
fail, either my queries don't retrieve any documents or I get an execution  
failure. I was using a local in memory node, but I switched to the  
ElasticsearchIntegrationTest class in hopes it would help, but it hasn't  
seemed to. In fact, the tests fail much more often now. My tests basically  
create some indices, index some documents, and then do some queries. After  
indexing, I have tried calling refresh() and flushAndRefresh() but neither  
seems to help. I also did a match all query in the data setup phase (before  
running the test queries) to make sure all the indexed documents were  
available and they seem to be.

The queries I am testing use filters. Could this cause issues? When the  
tests don't retrieve the correct number of documents, they never retrieve  
any documents. When there is a failure, the exception looks like this:

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
execute phase [query\_fetch], all shards failed; shardFailures  
{[ns5-TWPpRgKOChWz\_rBmFw][idx1][0]:  
RemoteTransportException[[node\_2][inet[/192.168.1.35:9302]][search/phase/query+fetch]];  
nested: QueryPhaseExecutionException[[idx1][0]:  
query[ConstantScore(+cache(published:[1395106335954 TO 1395106336354})  
+QueryWrapperFilter(text:"matching"~1))],from[0],size[20],sort[\<custom:"  
published":  
org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@6a3d610d\>!,\<custom:"\_id":  
org.elasticsearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource@63aed2f8\>]:  
Query Failed [Failed to execute main query]]; nested: AssertionError; }

at \_\_randomizedtesting.SeedInfo.seed([BD12B25E3037A620:CCB70675798538D0]:0)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:272)

at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:224)

at  
org.elasticsearch.search.action.SearchServiceTransportAction$7.handleException(SearchServiceTransportAction.java:324)  
...

Here is a sample query:

{

"from" : 0,

"size" : 20,

"timeout" : 9000,

"query" : {

```
"filtered" : {

  "query" : {

    "match_all" : { }

  },

  "filter" : {

    "and" : {

      "filters" : [ {

        "terms" : {

          "hash" : [ "wVAAiOFQbYk/+gb9tgr6qT7lxw1cInB5zeLK1ji99xs=", 

```

"vyrWhxzlvH61W1XUFVpf9josnk3SmO2lRp3JkhO8m+c=" ]

```
        }

      }, {

        "or" : {

          "filters" : [ {

            "query" : {

              "match" : {

                "text" : {

                  "query" : "matching",

                  "type" : "phrase",

                  "slop" : 1

                }

              }

            }

          } ]

        }

      } ]

    }

  }

}

```

},

"fields" : "docId",

"sort" : [ {

```
"published" : {

  "order" : "desc"

}

```

}, {

```
"_id" : { }

```

} ]

}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a9c18b14-eb96-49f1-95e0-e76924fc6108%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a9c18b14-eb96-49f1-95e0-e76924fc6108%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 18, 2014, 5:05pm UTC](https://discuss.elastic.co/t/integration-test-issues-with-elasticsearch/16413/2 "2014-03-18T17:05:00Z")

</div>

Please could you open an issue and try to provide the steps to reproduce  
this issue.

thanks

clint

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPt3XKT76pBaKao1Qb%2B8HtH66xMafBGRdBLow83Z6mrxfRqTGw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPt3XKT76pBaKao1Qb%2B8HtH66xMafBGRdBLow83Z6mrxfRqTGw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:42am UTC](https://discuss.elastic.co/t/integration-test-issues-with-elasticsearch/16413/3 "2017-07-06T01:42:29Z")

</div>


