New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bugfix] spec compliant random-number-generator #3072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ERROR] java:org.exist.xquery.XPathException exerr:ERROR cannot convert value of type xs:dateTime to Java object of type long [at line 32, column 31, source: /home/travis/build/eXist-db/exist/exist-core/src/test/xquery/xquery3/fnRandomNumberGenerator.xql]
1481In function:
1482 fn-rng:seed-dateTime() [17:5:/home/travis/build/eXist-db/exist/exist-core/src/test/xquery/xquery3/fnRandomNumberGenerator.xql]
1483 test:apply(function(*), item()*) [560:9:/home/travis/build/eXist-db/exist/exist-core/target/classes/org/exist/xquery/lib/xqsuite/xqsuite.xql]
1484 test:apply(function(*), element(), item()*) [467:9:/home/travis/build/eXist-db/exist/exist-core/target/classes/org/exist/xquery/lib/xqsuite/xqsuite.xql]
1485 test:call-test(function(*), element(), element()*) [279:32:/home/travis/build/eXist-db/exist/exist-core/target/classes/org/exist/xquery/lib/xqsuite/xqsuite.xql]. cannot convert value of type xs:dateTime to Java object of type long [at line 32, column 31]
1486[ERROR] err:FORG0001 Invalid value for cast/constructor. can not convert 'sample seed' to xs:long [at line 20, column 27]
some type casting problem it seems
Yes, this is will fail until the function is implemented according to spec. |
To merge this now i d suggest expecting the error and linking to #3071 in an inline comment, this way we would track changes in behaviour moving forward. Unless you have a fix to the underlying java implementation ready to go, so we could add it to this PR ? |
I would rather leave this open until the the fix is in place, @duncdrum . |
@line-o happy to take a look at this with you when we meet during XML Prague 2020. |
c47f900
to
bb80848
Compare
…ext() calls on the same generator
@adamretter I just checked the spread of the random numbers ( |
@line-o you should find that they are better than java.util.Random |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would would like to see this merged as it is.
@line-o sounds good, but as you and I both worked on it - you will have to find someone else to review and merge (if they are happy). The rule is - "you never merge your own PRs" |
I know :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I re-ran the one failing CI test, and it now all passes.
I’m curious to know, are we passing more of the qt3 tests for this function after the bug fix? |
@joewiz with the XQTS runner after modifying $ java -jar exist-xqts-runner-assembly-1.0.0.jar --xqts-version HEAD --test-set fn-random-number-generator Yields the results:
Not great I know! But... in this PR I only focused on fixing the two bugs that @line-o reported to me. |
Well these two amounted for more than 10%, I think it was worth the effort. |
@line-o No, you can run the XQTS. I think you will particularly groan at the |
See also - #3249 |
Description:
fn:random-number-generator
fn:random-number-generator()?next()
are deterministicReference:
fixes #3071
Type of tests:
xqsuite