From c1872b659529860a2e395d243038b8e10a467a33 Mon Sep 17 00:00:00 2001 From: Nils Bandener <33570290+nibix@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:17:49 +0200 Subject: [PATCH] Fixed flaky BWC test. (#4446) Signed-off-by: Nils Bandener --- .../security/bwc/SecurityBackwardsCompatibilityIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java b/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java index 9fe3bb1ef8..bd296fa90d 100644 --- a/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java +++ b/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java @@ -229,7 +229,8 @@ private void ingestData(String index) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); int numberOfRequests = Randomness.get().nextInt(10); while (numberOfRequests-- > 0) { - for (int i = 0; i < Randomness.get().nextInt(100); i++) { + int numberOfDocuments = Randomness.get().nextInt(100) + 1; + for (int i = 0; i < numberOfDocuments; i++) { Map> indexRequest = new HashMap<>(); indexRequest.put("index", new HashMap<>() { {