-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Description
This repro gets through ~47 merges and then bombs out. I tried this on 5.0.x but initially spotted the issue in a project still on 1.3.x so its nothing new. Commenting out Collections.shuffle makes the test pass. I'm on an intel MBP.
@Test
public void kllMergeOrdering() {
List<KllDoublesSketch> baseline = new ArrayList<>();
for(int x = 0; x < 90; x++) {
KllDoublesSketch kll = getUpdatableDirectDoublesSketch(200, 0);
DoubleStream.iterate(0.0, i -> i + 100.0).limit(100).forEach(d -> kll.update(d));
baseline.add(kll);
}
for(int iter = 0; iter < 1000; iter ++) {
KllDoublesSketch kll = null;
/******* Commenting out the shuffle makes it work?? **********/
Collections.shuffle(baseline);
for(KllDoublesSketch k : baseline) {
if(kll == null) {
kll = k;
} else {
kll.merge(k);
}
}
}
}
outputs
`java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
at org.apache.datasketches.kll.KllDoublesHelper.populateDoubleWorkArrays(KllDoublesHelper.java:459)
at org.apache.datasketches.kll.KllDoublesHelper.mergeDoubleImpl(KllDoublesHelper.java:159)
at org.apache.datasketches.kll.KllDoublesSketch.merge(KllDoublesSketch.java:281)
at org.apache.datasketches.kll.KllDirectDoublesSketchTest.kllMergeOrdering(KllDirectDoublesSketchTest.java:67)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:136)
at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:658)
at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:219)
at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:50)
at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:923)
at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:192)
at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:128)`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels