Skip to content

Commit e8ca840

Browse files
committed
[FLINK-36651][Connectors/Elasticsearch] Fix IT test not compatible with 1.20, drop main branch tests for 1.18
1 parent 6f2df6b commit e8ca840

File tree

4 files changed

+9
-47
lines changed

4 files changed

+9
-47
lines changed

.github/workflows/push_pr.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,8 @@ jobs:
2828
compile_and_test:
2929
strategy:
3030
matrix:
31-
flink: [ 1.18-SNAPSHOT ]
32-
jdk: [ '8, 11, 17' ]
33-
include:
34-
- flink: 1.19-SNAPSHOT
35-
jdk: '8, 11, 17, 21'
36-
- flink: 1.20-SNAPSHOT
37-
jdk: '8, 11, 17, 21'
31+
flink: [ 1.19-SNAPSHOT, 1.20-SNAPSHOT ]
32+
jdk: [ '8, 11, 17, 21' ]
3833
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
3934
with:
4035
flink_version: ${{ matrix.flink }}

.github/workflows/weekly.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,21 @@ jobs:
3030
strategy:
3131
matrix:
3232
flink_branches: [{
33-
flink: 1.18-SNAPSHOT,
34-
jdk: '8, 11, 17',
35-
branch: main
36-
}, {
3733
flink: 1.19-SNAPSHOT,
38-
jdk: '8, 11, 17, 21',
3934
branch: main
4035
}, {
4136
flink: 1.20-SNAPSHOT,
42-
jdk: '8, 11, 17, 21',
4337
branch: main
44-
}, {
45-
flink: 1.18.1,
46-
branch: v3.0
4738
}, {
4839
flink: 1.19.0,
4940
branch: v3.0
41+
}, {
42+
flink: 1.20.0,
43+
branch: main
5044
}]
5145
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
5246
with:
5347
flink_version: ${{ matrix.flink_branches.flink }}
5448
connector_branch: ${{ matrix.flink_branches.branch }}
55-
jdk_version: ${{ matrix.flink_branches.jdk || '8, 11' }}
49+
jdk_version: ${{ matrix.flink_branches.jdk || '8, 11, 17, 21' }}
5650
run_dependency_convergence: false

flink-connector-elasticsearch-base/src/test/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchWriterITCase.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.flink.connector.elasticsearch.sink;
1919

20-
import org.apache.flink.api.common.operators.MailboxExecutor;
2120
import org.apache.flink.api.connector.sink2.SinkWriter;
2221
import org.apache.flink.api.connector.sink2.SinkWriter.Context;
2322
import org.apache.flink.api.java.tuple.Tuple2;
@@ -31,14 +30,13 @@
3130
import org.apache.flink.metrics.groups.SinkWriterMetricGroup;
3231
import org.apache.flink.metrics.groups.UnregisteredMetricsGroup;
3332
import org.apache.flink.metrics.testutils.MetricListener;
33+
import org.apache.flink.runtime.mailbox.SyncMailboxExecutor;
3434
import org.apache.flink.runtime.metrics.MetricNames;
3535
import org.apache.flink.runtime.metrics.groups.InternalSinkWriterMetricGroup;
3636
import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
3737
import org.apache.flink.runtime.testutils.MiniClusterResourceConfiguration;
3838
import org.apache.flink.test.junit5.MiniClusterExtension;
39-
import org.apache.flink.util.FlinkRuntimeException;
4039
import org.apache.flink.util.TestLoggerExtension;
41-
import org.apache.flink.util.function.ThrowingRunnable;
4240

4341
import org.apache.http.HttpHost;
4442
import org.elasticsearch.action.ActionListener;
@@ -329,7 +327,7 @@ private static ElasticsearchWriter<Tuple2<Integer, String>> createWriter(
329327
new DefaultBulkResponseInspector(),
330328
new NetworkClientConfig(null, null, null, null, null, null, null, null),
331329
metricGroup,
332-
new TestMailbox());
330+
new SyncMailboxExecutor());
333331
}
334332

335333
private TestingSinkWriterMetricGroup getSinkWriterMetricGroup() {
@@ -481,29 +479,4 @@ GetResponse getResponse(String index, int id) throws IOException {
481479
return client.get(new GetRequest(index, Integer.toString(id)), RequestOptions.DEFAULT);
482480
}
483481
}
484-
485-
private static class TestMailbox implements MailboxExecutor {
486-
487-
@Override
488-
public void execute(
489-
ThrowingRunnable<? extends Exception> command,
490-
String descriptionFormat,
491-
Object... descriptionArgs) {
492-
try {
493-
command.run();
494-
} catch (Exception e) {
495-
throw new RuntimeException("Unexpected error", e);
496-
}
497-
}
498-
499-
@Override
500-
public void yield() throws InterruptedException, FlinkRuntimeException {
501-
Thread.sleep(100);
502-
}
503-
504-
@Override
505-
public boolean tryYield() throws FlinkRuntimeException {
506-
return false;
507-
}
508-
}
509482
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ under the License.
5151
</modules>
5252

5353
<properties>
54-
<flink.version>1.18.0</flink.version>
54+
<flink.version>1.20.0</flink.version>
5555

5656
<jackson-bom.version>2.15.3</jackson-bom.version>
5757
<junit4.version>4.13.2</junit4.version>

0 commit comments

Comments
 (0)