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 2020/04/07 05:52:46 UTC

[GitHub] [pulsar] murong00 opened a new pull request #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

murong00 opened a new pull request #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682
 
 
   ### Motivation
   
   In some new added pull requests the `CI - Unit / unit-tests` failed as below:
   
   ```
   [ERROR] testJsonSchema on testJsonSchema(org.apache.pulsar.io.influxdb.v2.InfluxDBSinkTest)(org.apache.pulsar.io.influxdb.v2.InfluxDBSinkTest)  Time elapsed: 0.026 s  <<< FAILURE!
   java.lang.AssertionError: expected: java.lang.String<1586235436221> but was: java.lang.Long<1586235436221>
   	at org.junit.Assert.fail(Assert.java:88)
   	at org.junit.Assert.failNotEquals(Assert.java:834)
   	at org.junit.Assert.assertEquals(Assert.java:118)
   	at org.junit.Assert.assertEquals(Assert.java:144)
   	at org.apache.pulsar.io.influxdb.v2.InfluxDBSinkTest.testJsonSchema(InfluxDBSinkTest.java:110)
   ```
   
   ### Modifications
   
   Just compare the `String` type when using `GenericJsonSchema` to pass the unit tests.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] lamber-ken commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
lamber-ken commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682#issuecomment-610595201
 
 
   Got, thanks : )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] lamber-ken commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
lamber-ken commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682#issuecomment-610339489
 
 
   Hi @murong00, the better way to fix this issue may is add type judgment to `org.apache.pulsar.client.impl.schema.generic.GenericJsonRecord`
   
   ```
   --- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java
   +++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java
   @@ -61,6 +61,8 @@ class GenericJsonRecord extends VersionedGenericRecord {
                return fn.asDouble();
            } else if (fn.isDouble()) {
                return fn.asDouble();
   +        } else if (fn.isLong()) {
   +            return fn.asLong();
            } else {
                return fn.asText();
            }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] sijie merged pull request #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] murong00 commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
murong00 commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682#issuecomment-610220462
 
 
   /pulsarbot run-failure-checks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] sijie commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682#issuecomment-610498674
 
 
   @lamber-ken I think we have changed the logic to return `numberValue()` if the type is a `number`. See https://github.com/apache/pulsar/blob/1aad3b73efe2a2afe0cd2598987f112416117159/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java#L67

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [pulsar] lamber-ken edited a comment on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest

Posted by GitBox <gi...@apache.org>.
lamber-ken edited a comment on issue #6682: [hotfix] Fix flaky test in InfluxDBSinkTest
URL: https://github.com/apache/pulsar/pull/6682#issuecomment-610339489
 
 
   Hi @murong00, the better way to fix this issue may is add type judgment to`GenericJsonRecord`
   
   ```
   --- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java
   +++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonRecord.java
   @@ -61,6 +61,8 @@ class GenericJsonRecord extends VersionedGenericRecord {
                return fn.asDouble();
            } else if (fn.isDouble()) {
                return fn.asDouble();
   +        } else if (fn.isLong()) {
   +            return fn.asLong();
            } else {
                return fn.asText();
            }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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