Github user cestella commented on a diff in the pull request:
https://github.com/apache/metron/pull/624#discussion_r124998536
--- Diff:
metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/KafkaControllerIntegrationTest.java
---
@@ -61,6 +62,7 @@
private static final int KAFKA_RETRY = 10;
@Autowired
private KafkaComponent kafkaWithZKComponent;
+ private ComponentRunner runner;
--- End diff --
I looked at it a bit this morning and @justinleet is right, it's not easily
done. I'm not super happy about spinning up and down components per test-case
considering the bulk of this PR has been around removing exactly that. That
being said, the test is ~20s, so I'm not going to lose any sleep over it on
that regard.
I think the part that I don't like most is the mixture of semantics between
Spring's wiring of components and JUnit's setting up of components that we
can't mix and match. It leaves a muddle, frankly:
* If someone needs more heavy-weight components in other tests in this
project, they will be *forced* into spinning up and down infrastructure per
test-case, which has proven costly and was a prominent thing that we targeted
in this PR for removal.
* Our approach leaves us doing component reuse in a way that is neither
standard based on the other components *nor* standard based on spring, which is
confusing and will inevitably lead to inefficient and confusing tests.
There is evidently a fix from spring
[here](https://github.com/spring-projects/spring-kafka/issues/194) and I'm
creating [METRON-1009](https://issues.apache.org/jira/browse/METRON-1009) to
capture the reversion of this unit test and uptaking the fix provided by spring.
@merrimanr is right, it's not a requirement to get this perfect as long as
we've removed the intermittent nature of the test failure (and I feel we have).
It's not so bad that I am -1, but it's ugly, confusing and it will lead to
errors in the future IMO.
---
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.
---