Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,29 @@ public void testRollupIDSchemeAfterRestart() throws Exception {
}
});

// After we've confirmed the doc, wait until we move back to STARTED so that we know the
// state was saved at the end
waitForRollUpJob("rollup-id-test", equalTo("started"));

} else {

final Request indexRequest = new Request("POST", "/id-test-rollup/_doc/2");
indexRequest.setJsonEntity("{\"timestamp\":\"2018-01-02T00:00:01\",\"value\":345}");
client().performRequest(indexRequest);

assertRollUpJob("rollup-id-test");
// stop the rollup job to force a state save, which will upgrade the ID
final Request stopRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_stop");
Map<String, Object> stopRollupJobResponse = entityAsMap(client().performRequest(stopRollupJobRequest));
assertThat(stopRollupJobResponse.get("stopped"), equalTo(Boolean.TRUE));

waitForRollUpJob("rollup-id-test", equalTo("stopped"));

// start the rollup job again
final Request startRollupJobRequest = new Request("POST", "_xpack/rollup/job/rollup-id-test/_start");
Map<String, Object> startRollupJobResponse = entityAsMap(client().performRequest(startRollupJobRequest));
assertThat(startRollupJobResponse.get("started"), equalTo(Boolean.TRUE));

waitForRollUpJob("rollup-id-test", anyOf(equalTo("indexing"), equalTo("started")));

assertBusy(() -> {
client().performRequest(new Request("POST", "id-test-results-rollup/_refresh"));
Expand Down