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

    https://github.com/apache/spark/pull/4961#discussion_r28048338
  
    --- 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 --
    
    No need for clearing other places in this PR. We will clear them up as we
    encounter them.
    
    On Thu, Apr 9, 2015 at 1:45 AM, Saisai Shao <[email protected]>
    wrote:
    
    > In
    > 
external/kafka/src/test/java/org/apache/spark/streaming/kafka/JavaDirectKafkaStreamSuite.java
    > <https://github.com/apache/spark/pull/4961#discussion_r28044578>:
    >
    > >        ssc.stop();
    > >        ssc = null;
    > > -      System.clearProperty("spark.driver.port");
    > > -      suiteBase.tearDownKafka();
    > > +    }
    > > +
    > > +    System.clearProperty("spark.driver.port");
    >
    > I think this is a quite old code before we have SparkConf, there are some
    > places in the unit test still have such code, do I need to clean them all?
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/spark/pull/4961/files#r28044578>.
    >



---
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