Failed test


(Lukáš Vlček) #1

I pulled fresh source today, ran gradlew test and got the following
Exception:

:test-integration:test
[ant:testng] ............Exception in thread
"elasticsearch[server3]clusterService#updateTask-pool-228-thread-1"
org.elasticsearch.index.shard.IllegalIndexShardStateException:
Index[test] Shard[6] CurrentState[CREATED] Read operations only
allowed when started/relocated
[ant:testng] at
org.elasticsearch.index.shard.InternalIndexShard.readAllowed(InternalIndexShard.java:
450)
[ant:testng] at
org.elasticsearch.index.shard.InternalIndexShard.snapshot(InternalIndexShard.java:
358)
[ant:testng] at
org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(IndexShardGatewayService.java:
148)
[ant:testng] at
org.elasticsearch.index.gateway.IndexShardGatewayService.close(IndexShardGatewayService.java:
169)
[ant:testng] at
org.elasticsearch.index.InternalIndexService.deleteShard(InternalIndexService.java:
230)
[ant:testng] at
org.elasticsearch.index.InternalIndexService.deleteShard(InternalIndexService.java:
203)
[ant:testng] at
org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:
215)
[ant:testng] at org.elasticsearch.cluster.DefaultClusterService
$2.run(DefaultClusterService.java:199)
[ant:testng] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
[ant:testng] at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
[ant:testng] at java.lang.Thread.run(Thread.java:636)
[ant:testng] F...........................
[ant:testng] ....

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/lukas/projects/elasticsearch/elasticsearch/modules/
    test/integration/build.gradle'

  • What went wrong:
    Execution failed for task ':test-integration:test'.
    Cause: There were failing tests. See the report at /home/lukas/
    projects/elasticsearch/elasticsearch/modules/test/integration/build/
    reports/tests.

The report says the following failed:
java.lang.AssertionError:
Expected: <22>
got: <21>

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:21)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at

org.elasticsearch.test.integration.indexlifecycle.IndexLifecycleActionTests.testIndexLifecycleActionsWith11Shards1Backup(IndexLifecycleActionTests.java:
112)
... Removed 22 stack frames

Click to hide stack frames

java.lang.AssertionError:
Expected: <22>
got: <21>

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:21)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
at

org.elasticsearch.test.integration.indexlifecycle.IndexLifecycleActionTests.testIndexLifecycleActionsWith11Shards1Backup(IndexLifecycleActionTests.java:
112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:
609)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:532)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:686)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1018)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:
128)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:
112)
at org.testng.TestRunner.runWorkers(TestRunner.java:759)
at org.testng.TestRunner.privateRun(TestRunner.java:592)
at org.testng.TestRunner.run(TestRunner.java:486)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.testng.TestNG.privateMain(TestNG.java:949)
at org.testng.TestNG.main(TestNG.java:922)

This is my java:
$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6) (fedora-30.b16.fc11-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)


(Shay Banon) #2

I will look into it. This is a test that fails sometimes because of timing
(in other words, badly written test). I need to add another small feature to
elasticsearch to make it work properly.

On Wed, Feb 17, 2010 at 9:08 AM, Lukas Vlcek lukas.vlcek@gmail.com wrote:

I pulled fresh source today, ran gradlew test and got the following
Exception:

:test-integration:test
[ant:testng] ............Exception in thread
"elasticsearch[server3]clusterService#updateTask-pool-228-thread-1"
org.elasticsearch.index.shard.IllegalIndexShardStateException:
Index[test] Shard[6] CurrentState[CREATED] Read operations only
allowed when started/relocated
[ant:testng] at

org.elasticsearch.index.shard.InternalIndexShard.readAllowed(InternalIndexShard.java:
450)
[ant:testng] at

org.elasticsearch.index.shard.InternalIndexShard.snapshot(InternalIndexShard.java:
358)
[ant:testng] at

org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(IndexShardGatewayService.java:
148)
[ant:testng] at

org.elasticsearch.index.gateway.IndexShardGatewayService.close(IndexShardGatewayService.java:
169)
[ant:testng] at

org.elasticsearch.index.InternalIndexService.deleteShard(InternalIndexService.java:
230)
[ant:testng] at

org.elasticsearch.index.InternalIndexService.deleteShard(InternalIndexService.java:
203)
[ant:testng] at

org.elasticsearch.indices.cluster.IndicesClusterStateService.clusterChanged(IndicesClusterStateService.java:
215)
[ant:testng] at org.elasticsearch.cluster.DefaultClusterService
$2.run(DefaultClusterService.java:199)
[ant:testng] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:
1110)
[ant:testng] at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:603)
[ant:testng] at java.lang.Thread.run(Thread.java:636)
[ant:testng] F...........................
[ant:testng] ....

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/lukas/projects/elasticsearch/elasticsearch/modules/
    test/integration/build.gradle'

  • What went wrong:
    Execution failed for task ':test-integration:test'.
    Cause: There were failing tests. See the report at /home/lukas/
    projects/elasticsearch/elasticsearch/modules/test/integration/build/
    reports/tests.

The report says the following failed:
java.lang.AssertionError:
Expected: <22>
got: <21>

   at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:21)
   at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
   at

org.elasticsearch.test.integration.indexlifecycle.IndexLifecycleActionTests.testIndexLifecycleActionsWith11Shards1Backup(IndexLifecycleActionTests.java:
112)
... Removed 22 stack frames

Click to hide stack frames

java.lang.AssertionError:
Expected: <22>
got: <21>

   at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:21)
   at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
   at

org.elasticsearch.test.integration.indexlifecycle.IndexLifecycleActionTests.testIndexLifecycleActionsWith11Shards1Backup(IndexLifecycleActionTests.java:
112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:
609)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:532)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:686)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1018)
at

org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:
128)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:
112)
at org.testng.TestRunner.runWorkers(TestRunner.java:759)
at org.testng.TestRunner.privateRun(TestRunner.java:592)
at org.testng.TestRunner.run(TestRunner.java:486)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.testng.TestNG.privateMain(TestNG.java:949)
at org.testng.TestNG.main(TestNG.java:922)

This is my java:
$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6) (fedora-30.b16.fc11-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)


(system) #3