Skip to content

Commit dc2059e

Browse files
authored
[ML] Make assertBusy() really wait in full cluster restart tests (#93641) (#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
1 parent 5e67c6f commit dc2059e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

x-pack/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/xpack/restart/MLModelDeploymentFullClusterRestartIT.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.Version;
1414
import org.elasticsearch.client.Request;
1515
import org.elasticsearch.client.Response;
16+
import org.elasticsearch.client.ResponseException;
1617
import org.elasticsearch.common.settings.Settings;
1718
import org.elasticsearch.common.util.concurrent.ThreadContext;
1819
import org.elasticsearch.common.xcontent.support.XContentMapValues;
@@ -105,8 +106,14 @@ public void testDeploymentSurvivesRestart() throws Exception {
105106
}));
106107
waitForDeploymentStarted(modelId);
107108
assertBusy(() -> {
108-
assertInfer(modelId);
109-
assertNewInfer(modelId);
109+
try {
110+
assertInfer(modelId);
111+
assertNewInfer(modelId);
112+
} catch (ResponseException e) {
113+
// assertBusy only loops on AssertionErrors, so we have
114+
// to convert failure status exceptions to these
115+
throw new AssertionError("Inference failed", e);
116+
}
110117
}, 90, TimeUnit.SECONDS);
111118
stopDeployment(modelId);
112119
}

0 commit comments

Comments
 (0)