Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] SmokeTestWatcherWithSecurityIT.testSearchInputWithInsufficientPrivileges Failure #29893

Closed
elasticmachine opened this issue Mar 23, 2018 · 4 comments · Fixed by #42764
Closed
Assignees
Labels
:Data Management/Watcher >test-failure Triaged test failures from CI

Comments

@elasticmachine
Copy link
Collaborator

Original comment by @martijnvg:

A different failure than in LINK REDACTED.

I was unable to reproduce this failure locally.

FAILURE 7.72s | SmokeTestWatcherWithSecurityIT.testSearchInputWithInsufficientPrivileges <<< FAILURES!
   > Throwable LINK REDACTED: java.lang.AssertionError: 
   > Expected: is "execution_not_needed"
   >      but: was "not_executed_already_queued"
   > 	at __randomizedtesting.SeedInfo.seed([B75EC64E2E3C5769:18369ABB27EDF467]:0)
   > 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
   > 	at org.elasticsearch.smoketest.SmokeTestWatcherWithSecurityIT.testSearchInputWithInsufficientPrivileges(SmokeTestWatcherWithSecurityIT.java:160)
   > 	at java.lang.Thread.run(Thread.java:748)

LINK REDACTED

Build url: LINK REDACTED

@DaveCTurner
Copy link
Contributor

jakelandis added a commit to jakelandis/elasticsearch that referenced this issue May 2, 2019
This commit unmutes the org.elasticsearch.smoketest.SmokeTestWatcherWithSecurityIT
test suite, fixes a bug [1] that was introduced while the test was muted, and
adds some additional debug logging, and enables debug for the ES instance used
in this Watcher test.

The bug fixed here is minor and unlikely to happen. It requires ES to be started
with ILM disabled, Watcher enabled, and Watcher explicitly stopped and restarted.
Due to validation Watcher does not fully start and can result in a partially started
state. This is an unlikely scenerio outside of the testing framework.

Optimistically closing the following
Fixes elastic#35361
Fixes elastic#30777
Fixes elastic#35361
Fixes elastic#33291
Fixes elastic#29893

If this does not fully fix the issue, there will now be better debug logging.
jakelandis added a commit to jakelandis/elasticsearch that referenced this issue May 10, 2019
There are likely multiple root causes to the seemingly random failures
generated by SmokeTestWatcherWithSecurityIT. This commit un-mutes this
this test, address one known cause and adds debug logging for this test.

The known root cause for one failure is that we can have a Watch running
that is reading data from an index. Before we stop Watcher we delete that
index. If Watcher happens to execute after deletion of the index but before
the stop of Watcher the test can fail. The fix here is to simply move the
index deletion after the stop of Watcher.

Related elastic#35361
Related elastic#30777
Related elastic#35361
Related elastic#33291
Related elastic#29893
jakelandis added a commit that referenced this issue May 24, 2019
* Address test failures for SmokeTestWatcherWithSecurityIT

There are likely multiple root causes to the seemingly random failures
generated by SmokeTestWatcherWithSecurityIT. This commit un-mutes this
this test, address one known cause and adds debug logging for this test.

The known root cause for one failure is that we can have a Watch running
that is reading data from an index. Before we stop Watcher we delete that
index. If Watcher happens to execute after deletion of the index but before
the stop of Watcher the test can fail. The fix here is to simply move the
index deletion after the stop of Watcher.

Related #35361
Related #30777
Related #33291
Related #29893
@jakelandis
Copy link
Contributor

Un-muted this test on PR #42409 to obtain additional logs.

If (when?) this test fails again please obtain the following information before muting the test:

  • Copy of the relevant failure
  • Copy of the reproduce line
  • The Jenkins build link
  • The Gradle scan link
  • The relevant cluster logs from "Google Cloud Storage Upload Report" (link found in Jenkins build)

gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this issue May 27, 2019
* Address test failures for SmokeTestWatcherWithSecurityIT

There are likely multiple root causes to the seemingly random failures
generated by SmokeTestWatcherWithSecurityIT. This commit un-mutes this
this test, address one known cause and adds debug logging for this test.

The known root cause for one failure is that we can have a Watch running
that is reading data from an index. Before we stop Watcher we delete that
index. If Watcher happens to execute after deletion of the index but before
the stop of Watcher the test can fail. The fix here is to simply move the
index deletion after the stop of Watcher.

Related elastic#35361
Related elastic#30777
Related elastic#33291
Related elastic#29893
@jakelandis
Copy link
Contributor

Copy of the relevant failure

Expected: is "execution_not_needed" but: was "not_executed_already_queued"

Stacktrace

java.lang.AssertionError:
Expected: is "execution_not_needed"
but: was "not_executed_already_queued"
at __randomizedtesting.SeedInfo.seed([8C6B46A3AC22313C:23031A56A5F39232]:0)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)
at org.elasticsearch.smoketest.SmokeTestWatcherWithSecurityIT.testSearchInputWithInsufficientPrivileges(SmokeTestWatcherWithSecurityIT.java:184)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
at java.base/java.lang.Thread.run(Thread.java:834)

Standard Output

[2019-05-31T07:04:45,233][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchInputWithInsufficientPrivileges] before test
[2019-05-31T07:04:45,437][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchInputWithInsufficientPrivileges] initializing REST clients against [http://[::1]:36713]
[2019-05-31T07:04:51,872][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchInputWithInsufficientPrivileges] after test
[2019-05-31T07:04:51,920][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchTransformInsufficientPermissions] before test
[2019-05-31T07:04:55,001][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchTransformInsufficientPermissions] after test
[2019-05-31T07:04:55,018][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testIndexActionInsufficientPrivileges] before test
[2019-05-31T07:04:58,013][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testIndexActionInsufficientPrivileges] after test
[2019-05-31T07:04:58,029][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchInputHasPermissions] before test
[2019-05-31T07:05:00,990][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchInputHasPermissions] after test
[2019-05-31T07:05:01,007][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchTransformHasPermissions] before test
[2019-05-31T07:05:03,976][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testSearchTransformHasPermissions] after test
[2019-05-31T07:05:03,991][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testIndexActionHasPermissions] before test
[2019-05-31T07:05:06,897][INFO ][o.e.s.SmokeTestWatcherWithSecurityIT] [testIndexActionHasPermissions] after test

Copy of the reproduce line

./gradlew :x-pack:qa:smoke-test-watcher-with-security:integTestRunner --tests "org.elasticsearch.smoketest.SmokeTestWatcherWithSecurityIT.testSearchInputWithInsufficientPrivileges" -Dtests.seed=8C6B46A3AC22313C -Dtests.security.manager=true -Dtests.locale=ha -Dtests.timezone=Asia/Omsk -Dcompiler.java=12 -Druntime.java=11

(does not reproduce)

The Jenkins build link

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+intake/3818/testReport/junit/org.elasticsearch.smoketest/SmokeTestWatcherWithSecurityIT/testSearchInputWithInsufficientPrivileges/

The Gradle scan link

https://gradle.com/s/kgzehspj7rn22

The relevant cluster logs from "Google Cloud Storage Upload Report" (link found in Jenkins build)

Link to full logs: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+intake/3818/gcsObjects
Server log file for this failure: x-pack_qa_smoke-test-watcher-with-security_integTestCluster.log

@jakelandis
Copy link
Contributor

I have a fix for this on #42764

Note - the "fix" does not guarantee this won't happen again, it just greatly reduces the odds of it happening by triggering fewer watches (to prevent concurrent watches) and adds a busy wait for expected state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment