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

[ML] Return assigned node in start/open job/datafeed response #55473

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More test fixes
droberts195 committed Apr 21, 2020
commit 19b7bb109687c2aba953780736926a76aef2e83a
Original file line number Diff line number Diff line change
@@ -1003,7 +1003,7 @@ public void testRealtime() throws Exception {
Request startRequest = new Request("POST", MachineLearning.BASE_PATH + "datafeeds/" + datafeedId + "/_start");
startRequest.addParameter("start", "2016-06-01T00:00:00Z");
Response response = client().performRequest(startRequest);
assertThat(EntityUtils.toString(response.getEntity()), equalTo("{\"started\":true}"));
assertThat(EntityUtils.toString(response.getEntity()), containsString("\"started\":true"));
assertBusy(() -> {
try {
Response getJobResponse = client().performRequest(new Request("GET",
@@ -1154,7 +1154,7 @@ private void startDatafeedAndWaitUntilStopped(String datafeedId, String authHead
options.addHeader("Authorization", authHeader);
request.setOptions(options);
Response startDatafeedResponse = client().performRequest(request);
assertThat(EntityUtils.toString(startDatafeedResponse.getEntity()), equalTo("{\"started\":true}"));
assertThat(EntityUtils.toString(startDatafeedResponse.getEntity()), containsString("\"started\":true"));
assertBusy(() -> {
try {
Response datafeedStatsResponse = client().performRequest(new Request("GET",
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
import org.junit.After;

import java.io.IOException;
import java.util.Collections;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@@ -125,7 +124,7 @@ public void testUsage() throws IOException {
assertEquals(2, XContentMapValues.extractValue("ml.jobs._all.count", usage));
assertEquals(2, XContentMapValues.extractValue("ml.jobs.closed.count", usage));
Response openResponse = client().performRequest(new Request("POST", MachineLearning.BASE_PATH + "anomaly_detectors/job-1/_open"));
assertEquals(Collections.singletonMap("opened", true), entityAsMap(openResponse));
assertThat(entityAsMap(openResponse), hasEntry("opened", true));
usage = entityAsMap(client().performRequest(new Request("GET", "_xpack/usage")));
assertEquals(2, XContentMapValues.extractValue("ml.jobs._all.count", usage));
assertEquals(1, XContentMapValues.extractValue("ml.jobs.closed.count", usage));