Skip to content

[CI] BasicWatcherTests.testModifyWatches fails in CI #35503

Closed
@jaymode

Description

@jaymode

BasicWatcherTests testModify watches failed in CI. I looked at the test and one possible cause could be a concurrent reloading of the watch service, which will remove all watches from the trigger engine since the trigger service gets paused. Looking at the logs we see a reload get triggered right after adding the watch due to new local watcher shard allocation ids. Maybe we should wait for a green cluster health or use ensureClusterStateConsistency in this test?

Failure link: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.x+release-tests/92/consoleFull

Reproduce line:

./gradlew :x-pack:plugin:watcher:test -Dtests.seed=CE0D14FE35FDBFFD -Dtests.class=org.elasticsearch.xpack.watcher.test.integration.BasicWatcherTests -Dtests.method="testModifyWatches" -Dtests.security.manager=true -Dbuild.snapshot=false -Dtests.jvm.argline="-Dbuild.snapshot=false" -Dtests.locale=pt-PT -Dtests.timezone=Asia/Bangkok -Dcompiler.java=11 -Druntime.java=8
  1> [2018-11-13T19:26:33,676][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] [BasicWatcherTests#testModifyWatches]: all set up test
  1> [2018-11-13T19:26:33,677][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] [BasicWatcherTests#testModifyWatches]: freezing time on nodes
  1> [2018-11-13T19:26:33,680][INFO ][o.e.c.m.MetaDataCreateIndexService] [node_s0] [.watches] creating index, cause [api], templates [.watches, random_index_template], shards [2]/[0], mappings [doc]
  1> [2018-11-13T19:26:33,680][INFO ][o.e.c.r.a.AllocationService] [node_s0] updating number_of_replicas to [1] for indices [.watches]
  1> [2018-11-13T19:26:33,721][INFO ][o.e.c.m.MetaDataCreateIndexService] [node_s0] [.triggered_watches] creating index, cause [api], templates [.triggered_watches, random_index_template], shards [1]/[1], mappings [doc]
  1> [2018-11-13T19:26:33,766][INFO ][o.e.c.m.MetaDataCreateIndexService] [node_s0] [.watcher-history-9-2018.11.13] creating index, cause [api], templates [.watch-history-9, random_index_template], shards [1]/[0], mappings [doc]
  1> [2018-11-13T19:26:33,766][INFO ][o.e.c.r.a.AllocationService] [node_s0] updating number_of_replicas to [1] for indices [.watcher-history-9-2018.11.13]
  1> [2018-11-13T19:26:33,797][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] creating watch history index [.watcher-history-9-2018.11.13]
  1> [2018-11-13T19:26:33,819][INFO ][o.e.c.r.a.AllocationService] [node_s0] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.watcher-history-9-2018.11.13][0]] ...]).
  1> [2018-11-13T19:26:33,824][DEBUG][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] indices [.watcher-history-9-2018.11.13, .watches, .triggered_watches] are green
  1> [2018-11-13T19:26:33,824][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] waiting to start watcher, current states [Tuple [v1=node_s1, v2=STOPPED], Tuple [v1=node_s2, v2=STOPPED], Tuple [v1=node_s0, v2=STOPPED]]
  1> [2018-11-13T19:26:33,830][DEBUG][o.e.x.w.WatcherService   ] [node_s2] watch service has been reloaded, reason [starting]
  1> [2018-11-13T19:26:33,830][DEBUG][o.e.x.w.WatcherService   ] [node_s1] watch service has been reloaded, reason [starting]
  1> [2018-11-13T19:26:33,831][DEBUG][o.e.x.w.WatcherService   ] [node_s0] watch service has been reloaded, reason [starting]
  1> [2018-11-13T19:26:33,831][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] waiting to start watcher, current states [Tuple [v1=node_s1, v2=STARTED], Tuple [v1=node_s2, v2=STARTED], Tuple [v1=node_s0, v2=STARTING]]
  1> [2018-11-13T19:26:33,834][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] waiting to start watcher, current states [Tuple [v1=node_s1, v2=STARTED], Tuple [v1=node_s2, v2=STARTED], Tuple [v1=node_s0, v2=STARTED]]
  1> [2018-11-13T19:26:33,836][INFO ][o.e.c.m.MetaDataCreateIndexService] [node_s0] [idx] creating index, cause [api], templates [random_index_template], shards [7]/[1], mappings []
  1> [2018-11-13T19:26:33,904][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s2] adding watch [_name] to trigger service
  1> [2018-11-13T19:26:33,904][DEBUG][o.e.x.w.t.ScheduleTriggerEngineMock] [node_s2] adding watch [_name]
  1> [2018-11-13T19:26:33,917][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s0] watch [_name] should not be triggered
  1> [2018-11-13T19:26:33,926][DEBUG][o.e.x.w.t.ScheduleTriggerEngineMock] [testModifyWatches] firing watch [_name] at [2018-11-13T12:26:38.677Z]
  1> [2018-11-13T19:26:33,927][DEBUG][o.e.x.w.e.ExecutionService] [testModifyWatches] saving watch records [1]
  1> [2018-11-13T19:26:33,931][DEBUG][o.e.x.w.e.ExecutionService] [testModifyWatches] executing watch [_name]
  1> [2018-11-13T19:26:33,933][DEBUG][o.e.x.w.i.s.ExecutableSearchInput] [testModifyWatches] [_name_887065ee-0c7f-4ae6-9947-269be07f5479-2018-11-13T12:26:38.677Z] found [0] hits
  1> [2018-11-13T19:26:33,936][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s2] adding watch [_name] to trigger service
  1> [2018-11-13T19:26:33,936][DEBUG][o.e.x.w.t.ScheduleTriggerEngineMock] [node_s2] adding watch [_name]
  1> [2018-11-13T19:26:33,939][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s0] watch [_name] should not be triggered
  1> [2018-11-13T19:26:33,948][INFO ][o.e.c.m.MetaDataMappingService] [node_s0] [.watcher-history-9-2018.11.13/CmR9DRQkQD2WEcvGyaQC7A] update_mapping [doc]
  1> [2018-11-13T19:26:33,966][DEBUG][o.e.x.w.e.ExecutionService] [testModifyWatches] finished [_name]/[_name_887065ee-0c7f-4ae6-9947-269be07f5479-2018-11-13T12:26:38.677Z]
  1> [2018-11-13T19:26:34,008][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s2] adding watch [_name] to trigger service
  1> [2018-11-13T19:26:34,008][DEBUG][o.e.x.w.t.ScheduleTriggerEngineMock] [node_s2] adding watch [_name]
  1> [2018-11-13T19:26:34,026][INFO ][o.e.c.r.a.AllocationService] [node_s0] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[idx][6]] ...]).
  1> [2018-11-13T19:26:34,027][DEBUG][o.e.x.w.WatcherIndexingListener] [node_s0] watch [_name] should not be triggered
  1> [2018-11-13T19:26:34,029][INFO ][o.e.x.w.WatcherService   ] [node_s1] reloading watcher, reason [new local watcher shard allocation ids], cancelled [0] queued tasks
  1> [2018-11-13T19:26:34,030][INFO ][o.e.x.w.WatcherService   ] [node_s2] reloading watcher, reason [new local watcher shard allocation ids], cancelled [0] queued tasks
  1> [2018-11-13T19:26:34,038][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] [#testModifyWatches]: clearing watcher state
  1> [2018-11-13T19:26:34,039][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] waiting to stop watcher, current states [Tuple [v1=node_s1, v2=STARTED], Tuple [v1=node_s2, v2=STARTED], Tuple [v1=node_s0, v2=STARTED]]
  1> [2018-11-13T19:26:34,042][INFO ][o.e.x.w.WatcherService   ] [node_s1] stopping watch service, reason [watcher manually marked to shutdown by cluster state update]
  1> [2018-11-13T19:26:34,042][INFO ][o.e.x.w.WatcherService   ] [node_s2] stopping watch service, reason [watcher manually marked to shutdown by cluster state update]
  1> [2018-11-13T19:26:34,045][INFO ][o.e.x.w.WatcherService   ] [node_s0] stopping watch service, reason [watcher manually marked to shutdown by cluster state update]
  1> [2018-11-13T19:26:34,048][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] waiting to stop watcher, current states [Tuple [v1=node_s1, v2=STOPPED], Tuple [v1=node_s2, v2=STOPPED], Tuple [v1=node_s0, v2=STOPPED]]
  1> [2018-11-13T19:26:34,048][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] [BasicWatcherTests#testModifyWatches]: cleaning up after test
  1> [2018-11-13T19:26:34,048][INFO ][o.e.t.InternalTestCluster] [testModifyWatches] Clearing active scheme time frozen, expected healing time 0s
  1> [2018-11-13T19:26:34,055][DEBUG][o.e.x.w.WatcherService   ] [node_s1] Loaded [0] watches for execution
  1> [2018-11-13T19:26:34,055][DEBUG][o.e.x.w.WatcherService   ] [node_s2] Loaded [1] watches for execution
  1> [2018-11-13T19:26:34,056][DEBUG][o.e.x.w.WatcherService   ] [node_s1] watch service has been reloaded, reason [new local watcher shard allocation ids]
  1> [2018-11-13T19:26:34,056][DEBUG][o.e.x.w.t.ScheduleTriggerEngineMock] [node_s2] adding watch [_name]
  1> [2018-11-13T19:26:34,056][DEBUG][o.e.x.w.WatcherService   ] [node_s2] watch service has been reloaded, reason [new local watcher shard allocation ids]
  1> [2018-11-13T19:26:34,065][INFO ][o.e.c.m.MetaDataDeleteIndexService] [node_s0] [idx/dvrs-NoDRECbdygx_jZlBA] deleting index
  1> [2018-11-13T19:26:34,065][INFO ][o.e.c.m.MetaDataDeleteIndexService] [node_s0] [.watches/4_uvYvRAQSabLevglsnYQg] deleting index
  1> [2018-11-13T19:26:34,066][INFO ][o.e.c.m.MetaDataDeleteIndexService] [node_s0] [.triggered_watches/HipCpVXNSWuosdZwXrIFBA] deleting index
  1> [2018-11-13T19:26:34,066][INFO ][o.e.c.m.MetaDataDeleteIndexService] [node_s0] [.watcher-history-9-2018.11.13/CmR9DRQkQD2WEcvGyaQC7A] deleting index
  1> [2018-11-13T19:26:34,123][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node_s0] removing template [random_index_template]
  1> [2018-11-13T19:26:34,128][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] [BasicWatcherTests#testModifyWatches]: cleaned up after test
  1> [2018-11-13T19:26:34,129][INFO ][o.e.x.w.t.i.BasicWatcherTests] [testModifyWatches] after test
FAILURE 0.50s J2 | BasicWatcherTests.testModifyWatches <<< FAILURES!
   > Throwable #1: java.lang.AssertionError: could not find watch [_name] to trigger
   > Expected: is <true>
   >      but: was <false>
   > 	at __randomizedtesting.SeedInfo.seed([CE0D14FE35FDBFFD:13C578BEB78E4397]:0)
   > 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
   > 	at org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase$TimeWarp.trigger(AbstractWatcherIntegrationTestCase.java:569)
   > 	at org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase$TimeWarp.trigger(AbstractWatcherIntegrationTestCase.java:559)
   > 	at org.elasticsearch.xpack.watcher.test.integration.BasicWatcherTests.testModifyWatches(BasicWatcherTests.java:195)
   > 	at java.lang.Thread.run(Thread.java:748)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions