Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4961#discussion_r28043286
  
    --- Diff: 
external/kafka/src/test/java/org/apache/spark/streaming/kafka/JavaDirectKafkaStreamSuite.java
 ---
    @@ -41,24 +41,31 @@
     
     public class JavaDirectKafkaStreamSuite implements Serializable {
       private transient JavaStreamingContext ssc = null;
    -  private transient KafkaStreamSuiteBase suiteBase = null;
    +  private transient KafkaTestUtils kafkaTestUtils = null;
     
       @Before
       public void setUp() {
    -      suiteBase = new KafkaStreamSuiteBase() { };
    -      suiteBase.setupKafka();
    -      System.clearProperty("spark.driver.port");
    -      SparkConf sparkConf = new SparkConf()
    -              
.setMaster("local[4]").setAppName(this.getClass().getSimpleName());
    -      ssc = new JavaStreamingContext(sparkConf, 
Durations.milliseconds(200));
    +    kafkaTestUtils = new KafkaTestUtils();
    +    kafkaTestUtils.setup();
    +    System.clearProperty("spark.driver.port");
    +    SparkConf sparkConf = new SparkConf()
    +      .setMaster("local[4]").setAppName(this.getClass().getSimpleName());
    +    ssc = new JavaStreamingContext(sparkConf, Durations.milliseconds(200));
       }
     
       @After
       public void tearDown() {
    +    if (ssc != null) {
           ssc.stop();
           ssc = null;
    -      System.clearProperty("spark.driver.port");
    -      suiteBase.tearDownKafka();
    +    }
    +
    +    System.clearProperty("spark.driver.port");
    --- End diff --
    
    nit: I dont think this is needed anymore.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to