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

[test failure] :x-pack:plugin:watcher:test can fail with java.lang.IllegalArgumentException: Both text and attachments cannot be null. #31948

Closed
jakelandis opened this issue Jul 11, 2018 · 13 comments · Fixed by #31968
Assignees
Labels
:Data Management/Watcher >test-failure Triaged test failures from CI

Comments

@jakelandis
Copy link
Contributor

I ran into this on an unrelated PR on the master branch, and can reliably reproduce.

ERROR   0.22s | SlackMessageTests.testTemplateRender <<< FAILURES!
   > Throwable #1: java.lang.IllegalArgumentException: Both text and attachments cannot be null.
   >    at __randomizedtesting.SeedInfo.seed([7E16EC5523F952E7:5C93EBB62B66EC8]:0)

Reproduce:

./gradlew :x-pack:plugin:watcher:test -Dtests.seed=7E16EC5523F952E7 -Dtests.class=org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests -Dtests.method="testTemplateRender" -Dtests.security.manager=true -Dtests.locale=hr -Dtests.timezone=Asia/Omsk

Recent relevant change: 8ec33b7#diff-b5bf09a9e8e2ab5019c940fe22bd8b25R34

Full text:

Suite: org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests
  1> [2018-07-10T20:58:22,638][WARN ][o.e.b.JNANatives         ] Unable to lock JVM Memory: error=78, reason=Function not implemented
  1> [2018-07-10T20:58:22,640][WARN ][o.e.b.JNANatives         ] This can result in part of the JVM being swapped out.
  1> [2018-07-11T07:58:23,314][INFO ][o.e.x.w.n.s.m.SlackMessageTests] [testTemplateRender]: before test
  1> [2018-07-11T07:58:23,507][INFO ][o.e.x.w.n.s.m.SlackMessageTests] [testTemplateRender]: after test
  2> REPRODUCE WITH: ./gradlew :x-pack:plugin:watcher:test -Dtests.seed=7E16EC5523F952E7 -Dtests.class=org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests -Dtests.method="testTemplateRender" -Dtests.security.manager=true -Dtests.locale=hr -Dtests.timezone=Asia/Omsk
ERROR   0.22s | SlackMessageTests.testTemplateRender <<< FAILURES!
   > Throwable #1: java.lang.IllegalArgumentException: Both text and attachments cannot be null.
   >    at __randomizedtesting.SeedInfo.seed([7E16EC5523F952E7:5C93EBB62B66EC8]:0)
   >    at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessage.<init>(SlackMessage.java:35)
   >    at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessage$Template.render(SlackMessage.java:210)
   >    at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests.testTemplateRender(SlackMessageTests.java:497)
   >    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:564)
   >    at java.base/java.lang.Thread.run(Thread.java:844)
  2> NOTE: leaving temporary files on disk at: /Users/jake/workspace/elasticsearch/x-pack/plugin/watcher/build/testrun/test/J0/temp/org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests_7E16EC5523F952E7-001
  2> NOTE: test params are: codec=Asserting(Lucene70), sim=RandomSimilarity(queryNorm=true): {}, locale=hr, timezone=Asia/Omsk
  2> NOTE: Mac OS X 10.12.6 x86_64/Oracle Corporation 10.0.1 (64-bit)/cpus=8,threads=1,free=493009280,total=536870912
  2> NOTE: All tests run in this JVM: [SlackMessageTests]
Completed [1/1] in 1.50s, 1 test, 1 error <<< FAILURES!

cc: @hub-cap

@jakelandis jakelandis added >test-failure Triaged test failures from CI :Data Management/Watcher labels Jul 11, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@spinscale
Copy link
Contributor

@hub-cap can you take a look? Might be caused by #31596

@ywelsch
Copy link
Contributor

ywelsch commented Jul 11, 2018

I've muted the test in dadf96a

@hub-cap
Copy link
Contributor

hub-cap commented Jul 11, 2018

on it. I already backported the other test this morning tho before seeing this. Should i push a mute to that test too?

hub-cap added a commit to hub-cap/elasticsearch that referenced this issue Jul 11, 2018
A new commit was merged that does not allow a null attachement &&
text. This is valid for the slack API, as it does not allow this, but
our unit tests did. This commit fixes the broken unit test.

Closes elastic#31948
@hub-cap
Copy link
Contributor

hub-cap commented Jul 11, 2018

I have a fix for this in #31968

hub-cap added a commit that referenced this issue Jul 11, 2018
A new commit was merged that does not allow a null attachement &&
text. This is valid for the slack API, as it does not allow this, but
our unit tests did. This commit fixes the broken unit test.

Closes #31948
hub-cap added a commit that referenced this issue Jul 11, 2018
A new commit was merged that does not allow a null attachement &&
text. This is valid for the slack API, as it does not allow this, but
our unit tests did. This commit fixes the broken unit test.

Closes #31948
@martijnvg
Copy link
Member

@hub-cap This error is still occuring: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.x+multijob-unix-compatibility/os=sles/1176/

First I thought the last good commit was not up to date, but it seems to use a commit after you pushed the fix.

  2> NOTE: leaving temporary files on disk at: /var/lib/jenkins/workspace/elastic+elasticsearch+6.x+multijob-unix-compatibility/os/sles/x-pack/plugin/watcher/build/testrun/test/J3/temp/org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests_C35892AD1F91E7C7-001
08:21:48    > Throwable #1: java.lang.IllegalArgumentException: Both text and attachments cannot be null.
08:21:48    > 	at __randomizedtesting.SeedInfo.seed([C35892AD1F91E7C7:B88740435EDEDBE8]:0)
08:21:48   2> NOTE: test params are: codec=Asserting(Lucene70): {}, docValues:{}, maxPointsInLeafNode=428, maxMBSortInHeap=6.408206805655725, sim=RandomSimilarity(queryNorm=true): {}, locale=ar, timezone=America/Coral_Harbour
08:21:48   2> NOTE: Linux 4.4.103-6.38-default amd64/Oracle Corporation 1.8.0_172 (64-bit)/cpus=16,threads=1,free=341246616,total=505937920
08:21:48    > 	at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessage.<init>(SlackMessage.java:35)
08:21:48   2> NOTE: All tests run in this JVM: [CronEvalToolTests, IncidentEventDefaultsTests, ArrayCompareConditionSearchTests, HipChatAccountsTests, WatcherTransportActionTests, HistoryTemplateEmailMappingsTests, TransportWatcherStatsActionTests, PagerDutyActionTests, ChainTransformTests, MapPathTests, SlackMessageTests]
08:21:48    > 	at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessage$Template.render(SlackMessage.java:210)
08:21:48    > 	at org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests.testTemplateRender(SlackMessageTests.java:497)
08:21:48    > 	at java.lang.Thread.run(Thread.java:748)

@original-brownbear
Copy link
Member

original-brownbear commented Jul 12, 2018

+1 this is still failing for me locally with master as well


> Task :x-pack:plugin:watcher:test
==> Test Info: seed=53EDEE31F2D2E609; jvms=4; suites=139

Suite: org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests
  1> [2018-07-12T09:11:18,855][INFO ][o.e.x.w.n.s.m.SlackMessageTests] [testTemplateRender]: before test
  1> [2018-07-12T09:11:18,857][INFO ][o.e.x.w.n.s.m.SlackMessageTests] [testTemplateRender]: after test
  2> REPRODUCE WITH: ./gradlew :x-pack:plugin:watcher:test -Dtests.seed=53EDEE31F2D2E609 -Dtests.class=org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests -Dtests.method="testTemplateRender" -Dtests.security.manager=true -Dtests.locale=pt -Dtests.timezone=Africa/Bissau
ERROR   0.01s J3 | SlackMessageTests.testTemplateRender <<< FAILURES!

@cbuescher
Copy link
Member

This still fails reproducibly on master:

REPRODUCE WITH:

 ./gradlew :x-pack:plugin:watcher:test -Dtests.seed=D037A2BE0DBB13AD -Dtests.class=org.elasticsearch.xpack.watcher.notification.slack.message.SlackMessageTests -Dtests.method="testTemplateRender" -Dtests.security.manager=true -Dtests.locale=en -Dtests.timezone=Atlantic/Azores

@cbuescher cbuescher reopened this Jul 12, 2018
@cbuescher
Copy link
Member

@hub-cap I muted this again in 332c134, maybe its a different reason now but the error looks different. Could you check?

@cbuescher
Copy link
Member

Also muted 6.x with where the same reproduction worked with fb6cce0

@hub-cap
Copy link
Contributor

hub-cap commented Jul 13, 2018

Thanks, ill verify. I thought there could be some funkyness with this change and the random behavior. Ill get on it, sorry for the noise.

hub-cap added a commit that referenced this issue Jul 13, 2018
There was still a case with a null text that allowed for 0 attachments
to be created. This commit ensures that greater than zero are created
if the text is null. Otherwise, it uses the same logic to create 0 to 3
random attachments.

Closes #31948
@hub-cap
Copy link
Contributor

hub-cap commented Jul 13, 2018

fixed and backported and tested with -Dtests.iters=2000 :)

@cbuescher
Copy link
Member

cbuescher commented Jul 13, 2018

2dy7yp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Watcher >test-failure Triaged test failures from CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants