pkuwm opened a new issue #965:
URL: https://github.com/apache/helix/issues/965
**Problem**
We've seen test failures in helix-rest for: `TestZkRoutingDataWriter` and
`TestZkRoutingDataReader`
```
[ERROR] Tests run: 155, Failures: 2, Errors: 0, Skipped: 11, Time elapsed:
141.162 s <<< FAILURE! - in TestSuite
[ERROR]
testAddMetadataStoreRealm(org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataWriter)
Time elapsed: 0.013 s <<< FAILURE!
org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError:
java.io.StreamCorruptedException: invalid stream header: 7B0A2020
at
org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataWriter.testAddMetadataStoreRealm(TestZkRoutingDataWriter.java:87)
Caused by: java.io.StreamCorruptedException: invalid stream header: 7B0A2020
at
org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataWriter.testAddMetadataStoreRealm(TestZkRoutingDataWriter.java:87)
[ERROR]
testGetRoutingData(org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataReader)
Time elapsed: 0.009 s <<< FAILURE!
org.apache.helix.zookeeper.zkclient.exception.ZkMarshallingError:
java.io.NotSerializableException: org.apache.helix.zookeeper.datamodel.ZNRecord
at
org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataReader.testGetRoutingData(TestZkRoutingDataReader.java:81)
Caused by: java.io.NotSerializableException:
org.apache.helix.zookeeper.datamodel.ZNRecord
at
org.apache.helix.rest.metadatastore.accessor.TestZkRoutingDataReader.testGetRoutingData(TestZkRoutingDataReader.java:81)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestZkRoutingDataReader.testGetRoutingData:81 » ZkMarshalling
java.io.NotSeria...
[ERROR] TestZkRoutingDataWriter.testAddMetadataStoreRealm:87 »
ZkMarshalling java.io.S...
[INFO]
[ERROR] Tests run: 155, Failures: 2, Errors: 0, Skipped: 11
```
**Root cause**
- In these tests, the zkClient is trying to read/write ZNRecords, but
zkClient's serializer is not a `ZNRecordSerializer` but a `BasicZkSerializer`.
So when read/write a ZNRecord, a `ZkMarshallingError` is thrown and causes the
tests failed.
- Some developers don't see these failures, because the ordering of running
tests are different on different environments (different maven version, OS).
And the zkClient's is a based one and its serializer type is changed to
`ZNRecordSerializer` in other tests. So if other tests are run before
`TestZkRoutingDataWriter`, the tests pass. Otherwise, some developers would see
the failures.
**Solution**
Change to use `_gZkClientTestNS` which uses `ZNRecordSerializer`.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]