{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/33561","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/33561/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/33561/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/33561/events","html_url":"https://github.com/elastic/elasticsearch/issues/33561","id":358539702,"node_id":"MDU6SXNzdWUzNTg1Mzk3MDI=","number":33561,"title":"ForecastIT testDelete failed","user":{"login":"droberts195","id":7405510,"node_id":"MDQ6VXNlcjc0MDU1MTA=","avatar_url":"https://avatars0.githubusercontent.com/u/7405510?v=4","gravatar_id":"","url":"https://api.github.com/users/droberts195","html_url":"https://github.com/droberts195","followers_url":"https://api.github.com/users/droberts195/followers","following_url":"https://api.github.com/users/droberts195/following{/other_user}","gists_url":"https://api.github.com/users/droberts195/gists{/gist_id}","starred_url":"https://api.github.com/users/droberts195/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/droberts195/subscriptions","organizations_url":"https://api.github.com/users/droberts195/orgs","repos_url":"https://api.github.com/users/droberts195/repos","events_url":"https://api.github.com/users/droberts195/events{/privacy}","received_events_url":"https://api.github.com/users/droberts195/received_events","type":"User","site_admin":false},"labels":[{"id":912833043,"node_id":"MDU6TGFiZWw5MTI4MzMwNDM=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:ml","name":":ml","color":"0e8a16","default":false},{"id":148612629,"node_id":"MDU6TGFiZWwxNDg2MTI2Mjk=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Etest-failure","name":">test-failure","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-10T09:27:28Z","updated_at":"2018-09-10T09:27:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This happened in \r\nhttps://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-unix-compatibility/os=sles/2661/consoleText\r\n\r\nThe REPRO line is this, although since it's timing-related it won't reproduce reliably:\r\n\r\n```\r\n./gradlew :x-pack:plugin:ml:qa:native-multi-node-tests:integTestRunner \\\r\n  -Dtests.seed=C417041F0B398073 \\\r\n  -Dtests.class=org.elasticsearch.xpack.ml.integration.ForecastIT \\\r\n  -Dtests.method=\"testDelete\" \\\r\n  -Dtests.security.manager=true \\\r\n  -Dtests.locale=ja-JP \\\r\n  -Dtests.timezone=Asia/Tbilisi \\\r\n  -Dcompiler.java=10 \\\r\n  -Druntime.java=8\r\n```\r\n\r\nI think the problem is that we're not refreshing the index after deleting the forecast documents, yet the test is assuming that all documents will be unsearchable when the delete call returns.  I think it's good that the contract of the delete forecast endpoint is that you will not find documents related to the forecast if you search for them after the endpoint returns.  So that means we need to refresh the index in the delete forecast code.  The simplest way should be to add `setRefresh(true)` to the DBQ request, similar to https://github.com/elastic/elasticsearch/blob/284c45a6ffb1a4eb2ce7498db25d362cae2c0c02/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/persistence/JobStorageDeletionTask.java#L103"}}
{"actor":{"display_login":"droberts195"}}