yurloc opened a new issue, #804:
URL: https://github.com/apache/incubator-kie-issues/issues/804

   The test contains a bug that results in `java.lang.IllegalArgumentException: 
bound must be positive` here:
   
   
https://github.com/apache/incubator-kie-drools/blob/18047e93c81c3502cd759fbe3e8ce0c8f2e796f4/kie-pmml-trusty/kie-pmml-evaluator/kie-pmml-evaluator-core/src/test/java/org/kie/pmml/evaluator/core/PMMLRuntimeContextImplTest.java#L93
   
   It uses a `Random` to produce the test input data so it passes most of the 
time but it fails occasionally. To reproduce (with high probability), change 
the test annotation to `@RepeatedTest(2000)`.
   
   Stack trace:
   ```
   java.lang.IllegalArgumentException: bound must be positive
   
        at java.base/java.util.Random.nextInt(Random.java:321)
        at 
org.kie.pmml.evaluator.core.PMMLRuntimeContextImplTest.lambda$getFixedProbabilityMap$0(PMMLRuntimeContextImplTest.java:93)
        at 
java.base/java.util.stream.IntPipeline$6$1.accept(IntPipeline.java:286)
        at 
java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104)
        at 
java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:711)
        at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
        at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at 
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
        at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at 
java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
        at 
org.kie.pmml.evaluator.core.PMMLRuntimeContextImplTest.getFixedProbabilityMap(PMMLRuntimeContextImplTest.java:98)
           ...
   ```
   
   Fix suggestion: don't use `Random` to generate the test input, use 
hard-coded values instead. Optionally, transform the test into a 
`@ParameterizedTest` to cover more input data combinations.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to