[ML] Document test problem and make it slightly less likely

Relates elastic/x-pack-elasticsearch#689

This does NOT fix the problem, but makes it clearer why it happens
and, by changing ordering, should make it happen less often

Original commit: elastic/x-pack-elasticsearch@9ef60073c2
This commit is contained in:
David Roberts 2017-03-02 14:18:31 +00:00
parent 746eb2ead4
commit 2c365311af
1 changed files with 41 additions and 17 deletions

View File

@ -93,20 +93,19 @@ setup:
job_id: farequote2
- match: { closed: true }
- do:
indices.exists:
index: ".ml-anomalies-farequote"
- is_true: ''
- do:
indices.exists:
index: ".ml-anomalies-farequote"
- is_true: ''
- do:
indices.refresh: {}
- do:
indices.exists:
index: ".ml-anomalies-farequote"
- is_true: ''
- do:
indices.exists:
index: ".ml-anomalies-farequote"
- is_true: ''
- do:
count:
index: .ml-anomalies-shared
@ -164,14 +163,18 @@ setup:
job_id: "farequote"
- match: { acknowledged: true }
- do:
indices.refresh: {}
# TODO: delete_job is asynchronous and returns before all job results are deleted - ideally
# we'd have a way to wait for delete_job to finish its work, but for now just assert some
# other things before refreshing the indexes to give time for delete_job to do its work
- do:
indices.exists:
index: ".ml-anomalies-shared"
- is_true: ''
- do:
indices.refresh: {}
- do:
count:
index: .ml-anomalies-shared
@ -218,8 +221,9 @@ setup:
job_id: "farequote2"
- match: { acknowledged: true }
- do:
indices.refresh: {}
# TODO: delete_job is asynchronous and returns before all job results are deleted - ideally
# we'd have a way to wait for delete_job to finish its work, but for now just assert some
# other things before refreshing the indexes to give time for delete_job to do its work
- do:
indices.exists:
@ -236,6 +240,9 @@ setup:
index: ".ml-anomalies-farequote2"
- is_false: ''
- do:
indices.refresh: {}
- do:
count:
index: .ml-anomalies-shared
@ -323,8 +330,27 @@ setup:
job_id: "farequote"
- match: { acknowledged: true }
# TODO: delete_job is asynchronous and returns before all job results are deleted - ideally
# we'd have a way to wait for delete_job to finish its work, but for now just assert some
# other things before refreshing the indexes to give time for delete_job to do its work
- do:
indices.refresh: {}
indices.exists:
index: ".ml-anomalies-shared"
- is_true: ''
- do:
indices.exists:
index: ".ml-anomalies-foo"
- is_true: ''
- do:
indices.exists:
index: "foo"
- is_true: ''
- do:
indices.refresh: {}
- do:
count:
@ -341,5 +367,3 @@ setup:
index: .ml-anomalies-foo
- match: {count: 2}