metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <...@git.apache.org>
Subject [GitHub] incubator-metron pull request #491: METRON-773: Intermittent unit test error...
Date Mon, 27 Mar 2017 14:59:06 GMT
Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/491#discussion_r108192355
  
    --- Diff: metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/KafkaControllerIntegrationTest.java
---
    @@ -54,135 +58,165 @@
     @ActiveProfiles(TEST_PROFILE)
     public class KafkaControllerIntegrationTest {
     
    -    @Autowired
    -    private KafkaComponent kafkaWithZKComponent;
    -
    -    class SampleDataRunner implements Runnable {
    -
    -        private boolean stop = false;
    -        private String path = "../../metron-platform/metron-integration-test/src/main/sample/data/bro/raw/BroExampleOutput";
    -
    -        @Override
    -        public void run() {
    -            SampleDataGenerator broSampleDataGenerator = new SampleDataGenerator();
    -            broSampleDataGenerator.setBrokerUrl(kafkaWithZKComponent.getBrokerList());
    -            broSampleDataGenerator.setNum(1);
    -            broSampleDataGenerator.setSelectedSensorType("bro");
    -            broSampleDataGenerator.setDelay(0);
    -            try {
    -                while(!stop) {
    -                    broSampleDataGenerator.generateSampleData(path);
    -                }
    -            } catch (IOException e) {
    -                e.printStackTrace();
    -            } catch (ParseException e) {
    -                e.printStackTrace();
    -            }
    -        }
    -
    -        public void stop() {
    -            stop = true;
    +  private static final int KAFKA_RETRY = 10;
    +  @Autowired
    +  private KafkaComponent kafkaWithZKComponent;
    +
    +  class SampleDataRunner implements Runnable {
    +
    +    private boolean stop = false;
    +    private String path = "../../metron-platform/metron-integration-test/src/main/sample/data/bro/raw/BroExampleOutput";
    +
    +    @Override
    +    public void run() {
    +      SampleDataGenerator broSampleDataGenerator = new SampleDataGenerator();
    +      broSampleDataGenerator.setBrokerUrl(kafkaWithZKComponent.getBrokerList());
    +      broSampleDataGenerator.setNum(1);
    +      broSampleDataGenerator.setSelectedSensorType("bro");
    +      broSampleDataGenerator.setDelay(0);
    +      try {
    +        while(!stop) {
    +          broSampleDataGenerator.generateSampleData(path);
             }
    +      } catch (IOException e) {
    --- End diff --
    
    Good catch, absolutely.  Thanks!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message