diff --git a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java index b3c128ef9efa9..94eefd4fb5e78 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java +++ b/x-pack/plugin/transform/qa/multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/transform/integration/TransformIT.java @@ -322,6 +322,12 @@ public void testStopWaitForCheckpoint() throws Exception { startTransform(config.getId(), RequestOptions.DEFAULT); + // wait until transform has been triggered and indexed at least 1 document + assertBusy(() -> { + var stateAndStats = getTransformStats(config.getId()); + assertThat((Integer) XContentMapValues.extractValue("stats.documents_indexed", stateAndStats), greaterThan(1)); + }); + // waitForCheckpoint: true should make the transform continue until we hit the first checkpoint, then it will stop stopTransform(transformId, false, null, true);