Skip to content

Commit 967bcf3

Browse files
authored
Release latches at the end of the test (elastic#121947) (elastic#121984)
* Release latches at the end of the test This may prevent failure contamination to other tests (cherry picked from commit ec2ac48) # Conflicts: # muted-tests.yml
1 parent 6c62409 commit 967bcf3

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,6 @@ tests:
543543
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
544544
method: testDependentVariableIsAliasToKeyword
545545
issue: https://github.com/elastic/elasticsearch/issues/121492
546-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
547-
method: testStopQueryLocalNoRemotes
548-
issue: https://github.com/elastic/elasticsearch/issues/121856
549-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
550-
method: testStopQueryLocal
551-
issue: https://github.com/elastic/elasticsearch/issues/121672
552546
- class: org.elasticsearch.xpack.ml.integration.ClassificationIT
553547
method: testWithOnlyTrainingRowsAndTrainingPercentIsFifty_DependentVariableIsBoolean
554548
issue: https://github.com/elastic/elasticsearch/issues/121680

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/AbstractCrossClusterTestCase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.elasticsearch.transport.RemoteClusterAware;
2424
import org.elasticsearch.xcontent.XContentBuilder;
2525
import org.elasticsearch.xcontent.json.JsonXContent;
26+
import org.junit.After;
2627
import org.junit.Before;
2728

2829
import java.io.IOException;
@@ -107,6 +108,13 @@ public void resetPlugin() {
107108
CrossClusterAsyncQueryIT.CountingPauseFieldPlugin.resetPlugin();
108109
}
109110

111+
@After
112+
public void releaseLatches() {
113+
SimplePauseFieldPlugin.release();
114+
FailingPauseFieldPlugin.release();
115+
CrossClusterAsyncQueryIT.CountingPauseFieldPlugin.release();
116+
}
117+
110118
protected void assertClusterInfoSuccess(EsqlExecutionInfo.Cluster cluster, int numShards) {
111119
assertThat(cluster.getTook().millis(), greaterThanOrEqualTo(0L));
112120
assertThat(cluster.getStatus(), equalTo(EsqlExecutionInfo.Cluster.Status.SUCCESSFUL));

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClustersCancellationIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.xcontent.XContentBuilder;
2828
import org.elasticsearch.xcontent.json.JsonXContent;
2929
import org.elasticsearch.xpack.esql.plugin.ComputeService;
30+
import org.junit.After;
3031
import org.junit.Before;
3132

3233
import java.util.ArrayList;
@@ -76,6 +77,11 @@ public void resetPlugin() {
7677
SimplePauseFieldPlugin.resetPlugin();
7778
}
7879

80+
@After
81+
public void releasePlugin() {
82+
SimplePauseFieldPlugin.release();
83+
}
84+
7985
@Override
8086
protected boolean reuseClusters() {
8187
return false;

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/FailingPauseFieldPlugin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public static void resetPlugin() {
2929
startEmitting = new CountDownLatch(1);
3030
}
3131

32+
public static void release() {
33+
allowEmitting.countDown();
34+
}
35+
3236
@Override
3337
public void onStartExecute() {
3438
startEmitting.countDown();

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/SimplePauseFieldPlugin.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public static void resetPlugin() {
2424
startEmitting = new CountDownLatch(1);
2525
}
2626

27+
public static void release() {
28+
allowEmitting.countDown();
29+
}
30+
2731
@Override
2832
public void onStartExecute() {
2933
startEmitting.countDown();

0 commit comments

Comments
 (0)