RobertIndie opened a new issue, #193:
URL: https://github.com/apache/pulsar-client-cpp/issues/193

   ### Search before asking
   
   - [X] I searched in the 
[issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing 
similar.
   
   
   ### Version
   
   3.1 and master branch
   
   ### Minimal reproduce step
   
   * Use macos x86_64
   * Install protobuf 21.12
   * Run test `./pulsar-tests 
--gtest_filter="ProtobufNativeSchemaTest.testSchemaIncompatibility"`
   
   ### What did you expect to see?
   
   The test passed
   
   ### What did you see instead?
   
   The test failed:
   ```
   ➜  tests ./pulsar-tests 
--gtest_filter="ProtobufNativeSchemaTest.testSchemaIncompatibility"
   Note: Google Test filter = ProtobufNativeSchemaTest.testSchemaIncompatibility
   [==========] Running 1 test from 1 test suite.
   [----------] Global test environment set-up.
   [----------] 1 test from ProtobufNativeSchemaTest
   [ RUN      ] ProtobufNativeSchemaTest.testSchemaIncompatibility
   2023-02-14 15:23:04.272 INFO  [0x10d003600] ClientConnection:190 | [<none> 
-> pulsar://localhost:6650] Create ClientConnection, timeout=10000
   2023-02-14 15:23:04.273 INFO  [0x10d003600] ConnectionPool:97 | Created 
connection for pulsar://localhost:6650
   2023-02-14 15:23:04.275 WARN  [0x700009e8a000] ClientConnection:456 | 
[<none> -> pulsar://localhost:6650] Failed to establish connection: Connection 
refused
   2023-02-14 15:23:04.275 INFO  [0x700009e8a000] ClientConnection:388 | 
[127.0.0.1:64503 -> 127.0.0.1:6650] Connected to broker
   2023-02-14 15:23:04.314 INFO  [0x700009e8a000] HandlerBase:72 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 ] Getting connection from pool
   2023-02-14 15:23:04.356 INFO  [0x700009e8a000] ProducerImpl:202 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 ] Created producer on broker [127.0.0.1:64503 -> 127.0.0.1:6650]
   2023-02-14 15:23:04.356 INFO  [0x10d003600] ProducerImpl:740 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 standalone-120-9] Closing producer for topic 
persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility
   2023-02-14 15:23:04.356 INFO  [0x700009e8a000] ProducerImpl:704 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 standalone-120-9] Closed producer 0
   2023-02-14 15:23:04.357 INFO  [0x700009e8a000] HandlerBase:72 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 ] Getting connection from pool
   2023-02-14 15:23:04.366 INFO  [0x700009e8a000] ProducerImpl:202 | 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 ] Created producer on broker [127.0.0.1:64503 -> 127.0.0.1:6650]
   2023-02-14 15:23:04.366 INFO  [0x10d003600] ProducerImpl:695 | Producer - 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 standalone-120-9] , [batchMessageContainer = { BatchMessageContainer [size = 
0] [bytes = 0] [maxSize = 1000] [maxBytes = 131072] [topicName = 
persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility] 
[numberOfBatchesSent_ = 1] [averageBatchSize_ = 0] }]
   
/Users/aaronrobert/codebase/cpp-verify/apache-pulsar-client-cpp-3.1.2/tests/ProtobufNativeSchemaTest.cc:109:
 Failure
   Expected equality of these values:
     ResultIncompatibleSchema
       Which is: IncompatibleSchema
     createProducerResult(getExternalMessageDescriptor())
       Which is: Ok
   2023-02-14 15:23:04.366 INFO  [0x10d003600] ProducerImpl:695 | Producer - 
[persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility,
 standalone-120-10] , [batchMessageContainer = { BatchMessageContainer [size = 
0] [bytes = 0] [maxSize = 1000] [maxBytes = 131072] [topicName = 
persistent://public/default/ProtobufNativeSchemaTest-testSchemaIncompatibility] 
[numberOfBatchesSent_ = 0] [averageBatchSize_ = 0] }]
   2023-02-14 15:23:04.366 INFO  [0x10d003600] ClientConnection:1600 | 
[127.0.0.1:64503 -> 127.0.0.1:6650] Connection closed with ConnectError
   2023-02-14 15:23:04.366 INFO  [0x10d003600] ClientConnection:269 | 
[127.0.0.1:64503 -> 127.0.0.1:6650] Destroyed connection
   [  FAILED  ] ProtobufNativeSchemaTest.testSchemaIncompatibility (96 ms)
   [----------] 1 test from ProtobufNativeSchemaTest (96 ms total)
   
   [----------] Global test environment tear-down
   [==========] 1 test from 1 test suite ran. (96 ms total)
   [  PASSED  ] 0 tests.
   [  FAILED  ] 1 test, listed below:
   [  FAILED  ] ProtobufNativeSchemaTest.testSchemaIncompatibility
   
    1 FAILED TEST
   
   ```
   
   ### Anything else?
   
   The root cause may be here:
   
https://github.com/apache/pulsar-client-cpp/blob/c3e3e8add445b8afe1a6cf5c396244b54e8e3218/tests/ProtobufNativeSchemaTest.cc#L41-L48
   
   If `GOOGLE_PROTOBUF_VERSION >= 3020000`, it will return the same message 
descriptor, which results in the assertion failing: 
https://github.com/apache/pulsar-client-cpp/blob/c3e3e8add445b8afe1a6cf5c396244b54e8e3218/tests/ProtobufNativeSchemaTest.cc#L109
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to