[
https://issues.apache.org/jira/browse/FLINK-24077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17451078#comment-17451078
]
Jing Ge commented on FLINK-24077:
---------------------------------
The flaky issue happened occasionally based on some unknown race conditions
during the CI process. Since the DML(i.e. Select operation in this case) job is
executed asynchronously, the tableResult collecting could be started after the
first row has been arrived. It looks like the we collected only partial
result(3, expected 8) sometimes while asserting.
In order to make the test stable. I have done the following improvements:
# After the Insert operation, run
{code:java}
batchEnv.sqlQuery("SELECT COUNT(h.rowkey) FROM " + TEST_TABLE_2 + " AS h");
{code}
to check if the Insert operation works before testing the SELECT operation.
2. After executing the SELECT query, call
{code:java}
// wait to finish
tableResult2.getJobClient().get().getJobExecutionResult().get(); {code}
to wait to finish.
I have changed the test locally to be a parametrized test and repeat 20 times
for each test run. Until now, it has been checked on my local laptop more than
500 times. Zero issue has been found.
> HBaseConnectorITCase.testTableSink
> ----------------------------------
>
> Key: FLINK-24077
> URL: https://issues.apache.org/jira/browse/FLINK-24077
> Project: Flink
> Issue Type: Bug
> Components: Connectors / HBase, Table SQL / Ecosystem
> Affects Versions: 1.14.0, 1.15.0
> Reporter: Xintong Song
> Assignee: Jing Ge
> Priority: Critical
> Labels: pull-request-available, test-stability
> Fix For: 1.15.0, 1.14.1
>
>
> https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=23160&view=logs&j=d44f43ce-542c-597d-bf94-b0718c71e5e8&t=ed165f3f-d0f6-524b-5279-86f8ee7d0e2d&l=12962
> {code}
> Aug 31 05:10:58 Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time
> elapsed: 73.758 sec <<< FAILURE! - in
> org.apache.flink.connector.hbase2.HBaseConnectorITCase
> Aug 31 05:10:58
> testTableSink(org.apache.flink.connector.hbase2.HBaseConnectorITCase) Time
> elapsed: 6.516 sec <<< FAILURE!
> Aug 31 05:10:58 java.lang.AssertionError:
> Aug 31 05:10:58 Different elements in arrays: expected 8 elements and
> received 3
> Aug 31 05:10:58 expected: [+I[1, 10, Hello-1, 100, 1.01, false, Welt-1],
> +I[2, 20, Hello-2, 200, 2.02, true, Welt-2], +I[3, 30, Hello-3, 300, 3.03,
> false, Welt-3], +I[4, 40, null, 400, 4.04, true, Welt-4], +I[5, 50, Hello-5,
> 500, 5.05, false, Welt-5], +I[6, 60, Hello-6, 600, 6.06, true, Welt-6], +I[7,
> 70, Hello-7, 700, 7.07, false, Welt-7], +I[8, 80, null, 800, 8.08, true,
> Welt-8]]
> Aug 31 05:10:58 received: [+I[1, 10, Hello-1, 100, 1.01, false, Welt-1],
> +I[2, 20, Hello-2, 200, 2.02, true, Welt-2], +I[3, 30, Hello-3, 300, 3.03,
> false, Welt-3]] expected:<8> but was:<3>
> Aug 31 05:10:58 at org.junit.Assert.fail(Assert.java:89)
> Aug 31 05:10:58 at org.junit.Assert.failNotEquals(Assert.java:835)
> Aug 31 05:10:58 at org.junit.Assert.assertEquals(Assert.java:647)
> Aug 31 05:10:58 at
> org.apache.flink.test.util.TestBaseUtils.compareResult(TestBaseUtils.java:395)
> Aug 31 05:10:58 at
> org.apache.flink.test.util.TestBaseUtils.compareResultAsText(TestBaseUtils.java:347)
> Aug 31 05:10:58 at
> org.apache.flink.connector.hbase2.HBaseConnectorITCase.testTableSink(HBaseConnectorITCase.java:284)
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)