Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10429 Redesign Flink Scheduling, introducing dedicated Scheduler component
  3. FLINK-14680

Enable KafkaConsumerTestBase#runFailOnNoBrokerTest to pass with new DefaultScheduler

    XMLWordPrintableJSON

Details

    Description

      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:

      		} 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"));
      			}
      		}
      

      Attachments

        Issue Links

          Activity

            People

              gjy Gary Yao
              gjy Gary Yao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m