Skip to content

Commit 0e7d854

Browse files
authored
[Transform] Reset plugin after tests (elastic#122252) (elastic#122423)
There is a race condition where the test is trying to clean up while the Transform auditor is still writing messages - resetting the plugin will stop the auditor (and properly reset it). Fix elastic#12148
1 parent fdd3812 commit 0e7d854

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

x-pack/plugin/transform/src/internalClusterTest/java/org/elasticsearch/xpack/transform/checkpoint/TransformCCSCanMatchIT.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.apache.lucene.index.PointValues;
1313
import org.apache.lucene.util.SetOnce;
1414
import org.elasticsearch.action.ActionListener;
15+
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateAction;
16+
import org.elasticsearch.action.admin.cluster.snapshots.features.ResetFeatureStateRequest;
1517
import org.elasticsearch.action.search.SearchRequest;
1618
import org.elasticsearch.action.support.IndicesOptions;
1719
import org.elasticsearch.action.support.master.AcknowledgedResponse;
@@ -61,6 +63,7 @@
6163
import org.elasticsearch.xpack.core.transform.transforms.TransformStats;
6264
import org.elasticsearch.xpack.core.transform.transforms.latest.LatestConfig;
6365
import org.elasticsearch.xpack.transform.LocalStateTransform;
66+
import org.junit.After;
6467
import org.junit.Before;
6568

6669
import java.io.IOException;
@@ -136,6 +139,11 @@ public void setUpNamedXContentRegistryAndIndices() throws Exception {
136139
remoteNewDocs = createIndexAndIndexDocs(REMOTE_CLUSTER, "remote_new_index", newRemoteNumShards, timestamp, randomBoolean());
137140
}
138141

142+
@After
143+
public void cleanup() {
144+
client().execute(ResetFeatureStateAction.INSTANCE, new ResetFeatureStateRequest(TEST_REQUEST_TIMEOUT)).actionGet();
145+
}
146+
139147
private int createIndexAndIndexDocs(String cluster, String index, int numberOfShards, long timestamp, boolean exposeTimestamp)
140148
throws Exception {
141149
Client client = client(cluster);

0 commit comments

Comments
 (0)