EXIficient / exificient-grammars

Java Implementation of EXI (grammars part)
http://exificient.github.io/java/
MIT License
4 stars 9 forks source link

Test failures when building exificient-grammars in Grammars2ExiTest for test_datatypes #18

Open jsbiff opened 1 year ago

jsbiff commented 1 year ago

Hi,

I was trying to build exificient-grammars, to build a grammar for use with exificient.js, and with jdk8, I got it to build, but it fails one of of the tests.

Ran maven clean, followed by maven install.


Results :

Failed tests: test_datatypes(com.siemens.ct.exi.grammars.persistency.Grammars2ExiTest): array lengths differed, expected.length=1011 actual.length=1041; arrays first differed at element [828]; expected:<4> but was:<7>

Tests run: 125, Failures: 1, Errors: 0, Skipped: 0

I don't exactly understand why that one out of all the tests failed. But, it seems like for that datatypes.xml file and corresponding xsd, that exificient is producing inconsistent output. I tried to understand it last night, but, I think it would take someone far more familiar with exificient core code to understand why it's failing.

I couldn't spot anything obviously wrong with the test method. It appears to run the same xml through exificient twice, and then compare the outputs, which should be the same, but are not somehow.

mvn -v Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29) Maven home: C:\Program Files\maven Java version: 1.8.0_352, vendor: Temurin, runtime: C:\Program Files\openjdk\jdk8u352\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

danielpeintner commented 1 year ago

Hi,

Kind of strange... I do not see the same issue.

Results :

Tests run: 125, Failures: 0, Errors: 0, Skipped: 0
mvn -v
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)
Maven home: C:\Tools\apache-maven-3.5.4\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_191\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Note: I haven't seen similar issues before..

jsbiff commented 1 year ago

Hmm, I am going to experiment with jdk and locale.

I notice your default locale is de_DE. Maybe it could be an issue that only shows up when NOT using de_DE as the default locale.

Or perhaps it's because I'm using OpenJDK and you're using the official Oracle JDK. In theory, you should be able to use any JDK to compile, but maybe there's some difference there.

Also, I see you are using JDK 8.0_191 while I was using 8.0_352. Perhaps it's an issue that occurs on newer JDK versions.

I'll do some testing, to try to isolate if any of those results in the issue.

I'll start by getting Oracle JDK 8.0_191, and see if the error goes away, then start changing things from there - assuming I don't repro the test failure with Oracle 8.0_191, I'll try Oracle 8.0_352. If the problem doesn't come back, then we know it's related to using OpenJDK, and I'll report the issue to the OpenJDK project.