Fixed the EnvUtilTest to be compatible with Windows OS and OpenJDK#2570
Fixed the EnvUtilTest to be compatible with Windows OS and OpenJDK#2570s4ravanan wants to merge 8 commits intoapache:masterfrom
Conversation
wu-sheng
left a comment
There was a problem hiding this comment.
I think if we are trying to make sure multiple JDKs/OSs compatible, we need to follow these two
- https://docs.travis-ci.com/user/languages/java/#testing-against-multiple-jdks
- https://docs.travis-ci.com/user/multi-os/
I am not sure the travis could provide the CI fast enough, but worth to try.
…moved the JDK 8 features as per the comments
…nts in the unit test
|
Could you try to add more jdk and OS versions to travis yml? |
|
Maybe I need to set other CI platform to support windows compile. @liuhaoyang |
|
@saravanan-kandaswamy Please help us verify this PR. I don't have windows and many jdk versions at local. Need you work on CI to support those and avoid this in the future. |
I have no knowledge on Travis-CI, i do know Jenkins though, let me know what kind of activity i need to do to setup the CI for windows. |
we use the appveyor platform to support windows compile. We have previously created an appveyor account for skyapm-dotnet and I will use it for testing. |
|
@liuhaoyang https://issues.apache.org/jira/browse/INFRA-18330 JIRA ticket submitted. Asking Apache INFRA to open it. |
|
OpenJDK passed in CI #2583 |
…alking into apm-data-unit-test
…daswamy/skywalking into apm-data-unit-test
…alking into apm-data-unit-test
…alking into apm-data-unit-test
|
Fixed in #2593 |
Please answer these questions before submitting your issue.
The Unit test EnvUtilTest.java case in apm-datacarrier module is not passing in Windows OS 10.
Question
Can we build the code in Windows Machine?
Bug
Skywalking - Latest Code base as of Master
OS - Windows 10
JRE - tried with Open JDK from Redhat and from Oracle JDK 8
Open JDK:
openjdk version "1.8.0_201-2-redhat"
OpenJDK Runtime Environment (build 1.8.0_201-2-redhat-b09)
Oracle JDK
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
I am trying the build source code in local system to write more unit tests, however the build is failing before that.
when I try to build apm-datacarrier the build fails with the following error
[INFO] Running org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest
[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.013 s <<< FAILURE! - in org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest
[ERROR] getInt(org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest) Time elapsed: 0.002 s <<< FAILURE!
java.lang.AssertionError: expected:<123> but was:<234>
at org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest.getInt(EnvUtilTest.java:56)
[ERROR] getLong(org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest) Time elapsed: 0 s <<< FAILURE!
java.lang.AssertionError: expected:<12345678901234567> but was:<123>
at org.apache.skywalking.apm.commons.datacarrier.EnvUtilTest.getLong(EnvUtilTest.java:62)
[INFO] Running org.apache.skywalking.apm.commons.datacarrier.partition.ProducerThreadPartitionerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.apache.skywalking.apm.commons.datacarrier.partition.ProducerThreadPartitionerTest
[INFO] Running org.apache.skywalking.apm.commons.datacarrier.partition.SimpleRollingPartitionerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.apache.skywalking.apm.commons.datacarrier.partition.SimpleRollingPartitionerTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] EnvUtilTest.getInt:56 expected:<123> but was:<234>
[ERROR] EnvUtilTest.getLong:62 expected:<12345678901234567> but was:<123>
[INFO]
[ERROR] Tests run: 17, Failures: 2, Errors: 0, Skipped: 0
Requirement or improvement
After little bit of search I found that the code doesn't work on Windows to make it work we need to follow the steps as mentioned in link:
https://stackoverflow.com/a/38073822
I have created the pull request with the necessary change.
Kindly review the same and let me know the results.
Thanks and Regards,
Saravanan Kandaswamy