Skip to content

Commit c6af64d

Browse files
authored
[test] Fix unstable test FlinkSinkWriterTest.testFlussSchemaChange. (apache#2116)
1 parent 453d64b commit c6af64d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/writer/FlinkSinkWriterTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,16 @@ void testFlussSchemaChange() throws Exception {
147147
new MockSinkWriterContext()))
148148
.rootCause()
149149
.isExactlyInstanceOf(ClassCastException.class)
150-
.hasMessageContaining(
151-
"class org.apache.flink.table.data.binary.BinaryStringData cannot be cast to class java.lang.Integer");
150+
.satisfiesAnyOf(
151+
// JDK8 format: no "class" prefix.
152+
e ->
153+
assertThat(e.getMessage())
154+
.contains(
155+
"org.apache.flink.table.data.binary.BinaryStringData cannot be cast to java.lang.Integer"),
156+
e ->
157+
assertThat(e.getMessage())
158+
.contains(
159+
"class org.apache.flink.table.data.binary.BinaryStringData cannot be cast to class java.lang.Integer"));
152160
writer.flush(false);
153161
}
154162
}

0 commit comments

Comments
 (0)