We're updating the issue view to help you get more done. 

Unit test DefaultElasticsearchClientFactoryTest.multipleHosts_failover_fault fails randomly because the timeout is too low

Description

The test DefaultElasticsearchClientFactoryTest.multipleHosts_failover_fault simulates a malformed HTTP response and tests that the failover works correctly in that case. The fault is probably generated randomly, because the tests seem to fail randomly... => I checked, and it's not generated randomly...

See for instance http://ci.hibernate.org/job/hibernate-search-PR/org.hibernate$hibernate-search-elasticsearch/2083/testReport/junit/org.hibernate.search.elasticsearch.test/DefaultElasticsearchClientFactoryTest/multipleHosts_failover_fault/ :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 Running org.hibernate.search.elasticsearch.test.DefaultElasticsearchAnalyzerDefinitionTranslatorTest Tests run: 19, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.721 sec - in org.hibernate.search.elasticsearch.test.DefaultElasticsearchAnalyzerDefinitionTranslatorTest Running org.hibernate.search.elasticsearch.test.DefaultElasticsearchClientFactoryTest Tests run: 12, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 13.703 sec <<< FAILURE! - in org.hibernate.search.elasticsearch.test.DefaultElasticsearchClientFactoryTest multipleHosts_failover_fault(org.hibernate.search.elasticsearch.test.DefaultElasticsearchClientFactoryTest) Time elapsed: 3.337 sec <<< ERROR! org.apache.http.MalformedChunkCodingException: Bad chunk header: lskdu018973t09sylgasjkfg1][]'./.sdlv at org.apache.http.impl.nio.codecs.ChunkDecoder.readChunkHead(ChunkDecoder.java:134) at org.apache.http.impl.nio.codecs.ChunkDecoder.read(ChunkDecoder.java:205) at org.apache.http.nio.util.SimpleInputBuffer.consumeContent(SimpleInputBuffer.java:66) at org.elasticsearch.client.HeapBufferedAsyncResponseConsumer.onContentReceived(HeapBufferedAsyncResponseConsumer.java:96) at org.apache.http.nio.protocol.AbstractAsyncResponseConsumer.consumeContent(AbstractAsyncResponseConsumer.java:141) at org.apache.http.impl.nio.client.MainClientExec.consumeContent(MainClientExec.java:329) at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.consumeContent(DefaultClientExchangeHandlerImpl.java:153) at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:324) at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265) at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81) at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39) at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114) at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337) at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315) at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276) at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104) at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588) at java.lang.Thread.run(Thread.java:745) Running org.hibernate.search.elasticsearch.test.ElasticsearchQueriesTest Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.hibernate.search.elasticsearch.test.ElasticsearchQueriesTest Running org.hibernate.search.elasticsearch.test.WindowTest Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.021 sec - in org.hibernate.search.elasticsearch.test.WindowTest Results : Tests in error: DefaultElasticsearchClientFactoryTest.multipleHosts_failover_fault » MalformedChunkCoding Tests run: 40, Failures: 0, Errors: 1, Skipped: 0 [ERROR] There are test failures.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Components

Fix versions

Affects versions

5.8.1.Final

Priority

Major