Skip to content

Commit

Permalink
[ML] Make assertBusy() really wait in full cluster restart tests (#93641
Browse files Browse the repository at this point in the history
) (#93646)

The exception being thrown that we want to ignore for 90 seconds
is not an AssertionError, so assertBusy was not looping for it.

Fixes #93325
  • Loading branch information
droberts195 committed Feb 9, 2023
1 parent 5e67c6f commit dc2059e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.elasticsearch.Version;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
Expand Down Expand Up @@ -105,8 +106,14 @@ public void testDeploymentSurvivesRestart() throws Exception {
}));
waitForDeploymentStarted(modelId);
assertBusy(() -> {
assertInfer(modelId);
assertNewInfer(modelId);
try {
assertInfer(modelId);
assertNewInfer(modelId);
} catch (ResponseException e) {
// assertBusy only loops on AssertionErrors, so we have
// to convert failure status exceptions to these
throw new AssertionError("Inference failed", e);
}
}, 90, TimeUnit.SECONDS);
stopDeployment(modelId);
}
Expand Down

0 comments on commit dc2059e

Please sign in to comment.