You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/18 04:57:30 UTC

[GitHub] merlimat closed pull request #2806: Added log statements to debug PulsarFunctionsTest.testJavaExclamationTopicPatternFunction

merlimat closed pull request #2806: Added log statements to debug PulsarFunctionsTest.testJavaExclamationTopicPatternFunction
URL: https://github.com/apache/pulsar/pull/2806
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java
index 0ea5404913..b8452f1d97 100644
--- a/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java
+++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java
@@ -78,12 +78,12 @@ public void testCassandraSink() throws Exception {
     public void testCassandraArchiveSink() throws Exception {
         testSink(CassandraSinkTester.createTester(false), false);
     }
-    
+
     @Test(enabled = false)
     public void testHdfsSink() throws Exception {
         testSink(new HdfsSinkTester(), false);
     }
-    
+
     @Test
     public void testJdbcSink() throws Exception {
         testSink(new JdbcSinkTester(), true);
@@ -93,7 +93,7 @@ public void testJdbcSink() throws Exception {
     public void testElasticSearchSink() throws Exception {
         testSink(new ElasticSearchSinkTester(), true);
     }
-    
+
     private void testSink(SinkTester tester, boolean builtin) throws Exception {
         tester.startServiceContainer(pulsarCluster);
         try {
@@ -669,9 +669,12 @@ private static void submitExclamationFunction(Runtime runtime,
                                            String functionClass,
                                            Schema<T> inputTopicSchema) throws Exception {
         CommandGenerator generator;
+        log.info("------- INPUT TOPIC: '{}'", inputTopicName);
         if (inputTopicName.endsWith(".*")) {
+            log.info("----- CREATING TOPIC PATTERN FUNCTION --- ");
             generator = CommandGenerator.createTopicPatternGenerator(inputTopicName, functionClass);
         } else {
+            log.info("----- CREATING REGULAR FUNCTION --- ");
             generator = CommandGenerator.createDefaultGenerator(inputTopicName, functionClass);
         }
         generator.setSinkTopic(outputTopicName);
@@ -685,6 +688,8 @@ private static void submitExclamationFunction(Runtime runtime,
         } else {
             throw new IllegalArgumentException("Unsupported runtime : " + runtime);
         }
+
+        log.info("---------- Function command: {}", command);
         String[] commands = {
             "sh", "-c", command
         };
@@ -721,6 +726,8 @@ private static void getFunctionInfoSuccess(String functionName) throws Exception
             "--namespace", "default",
             "--name", functionName
         );
+
+        log.info("FUNCTION STATE: {}", result.getStdout());
         assertTrue(result.getStdout().contains("\"name\": \"" + functionName + "\""));
     }
 
@@ -795,7 +802,8 @@ private static void publishAndConsumeMessages(String inputTopic,
         }
 
         for (int i = 0; i < numMessages; i++) {
-            Message<String> msg = consumer.receive(10, TimeUnit.SECONDS);
+            Message<String> msg = consumer.receive(30, TimeUnit.SECONDS);
+            log.info("Received: {}", msg.getValue());
             assertTrue(expectedMessages.contains(msg.getValue()));
             expectedMessages.remove(msg.getValue());
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services