Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/2245#discussion_r71869449
--- Diff:
flink-streaming-connectors/flink-connector-redis/src/test/java/org/apache/flink/streaming/connectors/redis/RedisSinkTest.java
---
@@ -105,18 +105,13 @@ private void testDownBehavior(FlinkJedisConfigBase
config) throws Exception {
try {
redisSink.open(new Configuration());
} catch (Throwable e) {
- Throwable init = e;
- // search for nested JedisConnectionExceptions
+ // search for the JedisConnectionExceptions
// because this is the expected behavior
-
- int depth = 0;
- while (!(e instanceof JedisConnectionException)) {
- e = e.getCause();
- if (e == null || depth++ == 20) {
- init.printStackTrace();
- fail("Test Failed: " +
init.getMessage());
- }
+
+ if (!(e instanceof JedisConnectionException)) {
+ e.printStackTrace();
+ fail("Test Failed: " + e.getMessage());
--- End diff --
I think it is better to let the exception bubble up instead of printing the
stack trace and calling `fail`.
---
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.
---