From c755a77022ce44b1ba8f8bfad19864a0b95b301d Mon Sep 17 00:00:00 2001 From: polyfractal Date: Tue, 17 May 2016 12:55:07 -0400 Subject: [PATCH] [TEST] Use a reproducible source of randomness in shuffle --- .../org/elasticsearch/ingest/processor/SortProcessorTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/ingest/processor/SortProcessorTests.java b/core/src/test/java/org/elasticsearch/ingest/processor/SortProcessorTests.java index f67ca3b6bee..18e35d00a79 100644 --- a/core/src/test/java/org/elasticsearch/ingest/processor/SortProcessorTests.java +++ b/core/src/test/java/org/elasticsearch/ingest/processor/SortProcessorTests.java @@ -30,6 +30,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Random; import java.util.stream.Collectors; import static org.hamcrest.Matchers.containsString; @@ -66,7 +67,7 @@ public class SortProcessorTests extends ESTestCase { Integer[] expectedResult = new Integer[]{1,2,3,4,5,10,20,21,22,50,100}; List fieldValue = new ArrayList<>(expectedResult.length); fieldValue.addAll(Arrays.asList(expectedResult).subList(0, expectedResult.length)); - Collections.shuffle(fieldValue); + Collections.shuffle(fieldValue, random()); String fieldName = RandomDocumentPicks.addRandomField(random(), ingestDocument, fieldValue); Processor processor = new SortProcessor(randomAsciiOfLength(10), fieldName, SortOrder.ASCENDING);