You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "eskabetxe (via GitHub)" <gi...@apache.org> on 2023/03/28 12:49:09 UTC

[GitHub] [flink] eskabetxe commented on a diff in pull request #22266: [FLINK-31525][tests] Stabilize JdbcExactlyOnceSinkE2eTest

eskabetxe commented on code in PR #22266:
URL: https://github.com/apache/flink/pull/22266#discussion_r1150557681


##########
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/xa/JdbcExactlyOnceSinkE2eTest.java:
##########
@@ -195,22 +181,20 @@ public void testInsert() throws Exception {
         long started = System.currentTimeMillis();
         LOG.info("Test insert for {}", dbEnv);
         int elementsPerSource = 50;
-        int numElementsPerCheckpoint = 7;
-        int minElementsPerFailure = numElementsPerCheckpoint / 3;
-        int maxElementsPerFailure = numElementsPerCheckpoint * 3;
+        int numElementsPerCheckpoint = 10;
+        int expectedFailures = elementsPerSource / numElementsPerCheckpoint;
 
         StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
         env.setParallelism(dbEnv.getParallelism());
-        env.setRestartStrategy(fixedDelayRestart(Integer.MAX_VALUE, Time.milliseconds(100)));
-        env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);
+        env.setRestartStrategy(fixedDelayRestart(expectedFailures * 2, Time.milliseconds(100)));
+        env.getConfig().setAutoWatermarkInterval(0L);

Review Comment:
   This test use a FailureMapper that fails in a Random way Random times, and uses the min and max ElementsPerFailure for that..
   I change this FailureMapper to fail the expectedFailures and have a predictable behaviour.
   
   The restartStrategy is change from a infinite (Integer.MAX_VALUE) to double of expected failures, so the test can fail in some way..
   
   What happen now with the Oracle test is that the test enters in a loop of failures but never get to max restarts and hangs up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org