[jira] [Created] (FLINK-14680) Enable KafkaConsumerTestBase#runFailOnNoBrokerTest to pass with new DefaultScheduler

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-14680) Enable KafkaConsumerTestBase#runFailOnNoBrokerTest to pass with new DefaultScheduler

Shang Yuanchun (Jira)
Gary Yao created FLINK-14680:
--------------------------------

             Summary: Enable KafkaConsumerTestBase#runFailOnNoBrokerTest to pass with new DefaultScheduler
                 Key: FLINK-14680
                 URL: https://issues.apache.org/jira/browse/FLINK-14680
             Project: Flink
          Issue Type: Sub-task
          Components: Runtime / Coordination, Tests
    Affects Versions: 1.10.0
            Reporter: Gary Yao
            Assignee: Gary Yao
             Fix For: 1.10.0


{{KafkaConsumerTestBase#runFailOnNoBrokerTest}} has assumptions on the causal chain of the {{JobExecutionException}}. In particular, it assumes that the exception caused by user code is the direct cause of {{JobExecutionException}}. However, this is no longer true when using the {{DefaultScheduler}}, which wraps the exception in an {{JobException}}, which additionally specifies the reason of the job recovery suppression.

The  code in question is listed below:
{code:java}
                } catch (JobExecutionException jee) {
                        if (kafkaServer.getVersion().equals("0.9") ||
                                kafkaServer.getVersion().equals("0.10") ||
                                kafkaServer.getVersion().equals("0.11") ||
                                kafkaServer.getVersion().equals("2.0")) {
                                assertTrue(jee.getCause() instanceof TimeoutException);

                                TimeoutException te = (TimeoutException) jee.getCause();

                                assertEquals("Timeout expired while fetching topic metadata", te.getMessage());
                        } else {
                                assertTrue(jee.getCause() instanceof RuntimeException);

                                RuntimeException re = (RuntimeException) jee.getCause();

                                assertTrue(re.getMessage().contains("Unable to retrieve any partitions"));
                        }
                }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)