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

Rewrite Inference yml tests for better clean up #61180

Merged
merged 5 commits into from
Aug 25, 2020

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented Aug 16, 2020

Inference processors asynchronously write to the .ml-stats index when in use. During a test this write may occur after the tests has finished and the test teardown has deleted the indices meaning the index is recreated post test. Depending on which test follows it may cause a test failure later.

This change rewrites the tests as ESRestTestCase and waits for the stats doc to be written at the end of the test.
I've put the test in the qa::single-node-tests project

The 2 tests I found causing this failure are

ml/inference_processor/Test create and delete pipeline with inference processor`
ml/inference_processor/Test create processor with deprecated fields

Closes #60876
Closes #58841

UPDATE
There is another race in this test where you can put a ingest pipeline to load the model but then the ingest pipeline may be deleted before the model is loaded in which means it will not write the stats and the wait for stats assertion will fail. The fix is to perform inference on the model which ensures it is loaded

@davidkyle davidkyle added >test Issues or PRs that are addressing/adding tests :ml Machine learning v8.0.0 v7.10.0 labels Aug 16, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@davidkyle davidkyle force-pushed the inference-yml-tests branch from 35a6fa6 to 8f14d8c Compare August 16, 2020 21:03
@davidkyle davidkyle force-pushed the inference-yml-tests branch from 8f14d8c to 4b56dd2 Compare August 17, 2020 08:44
Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@davidkyle davidkyle merged commit f4cfb9b into elastic:master Aug 25, 2020
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Aug 25, 2020
Inference processors asynchronously usage write stats to the .ml-stats index after they used. 
In tests the write can leak into the next test causing failures depending on which test follows.
This change waits for the usage stats docs to be written at the end of the test
davidkyle added a commit that referenced this pull request Aug 27, 2020
Inference processors asynchronously usage write stats to the .ml-stats index after they used. 
In tests the write can leak into the next test causing failures depending on which test follows.
This change waits for the usage stats docs to be written at the end of the test
davidkyle added a commit to davidkyle/elasticsearch that referenced this pull request Sep 7, 2020
Inference processors asynchronously usage write stats to the .ml-stats index after they used. 
In tests the write can leak into the next test causing failures depending on which test follows.
This change waits for the usage stats docs to be written at the end of the test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning >test Issues or PRs that are addressing/adding tests v7.10.0 v8.0.0-alpha1
Projects
None yet
4 participants