From 68d7a7605be6715a9c366cacd5226e0d5bc6d091 Mon Sep 17 00:00:00 2001 From: Kishan Kr Sharma Date: Wed, 20 Aug 2025 11:28:26 +0545 Subject: [PATCH 1/3] Fix:flaky test in snippets.SnippetsTests --- .gitignore | 3 +++ src/test/java/snippets/SnippetsTests.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 77576a3..aa8fff1 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,9 @@ buildNumber.properties # CMake cmake-build-debug/ +# .nondex igonre +.nondex + # Mongo Explorer plugin: .idea/**/mongoSettings.xml diff --git a/src/test/java/snippets/SnippetsTests.java b/src/test/java/snippets/SnippetsTests.java index c215ad7..5e3cfa8 100644 --- a/src/test/java/snippets/SnippetsTests.java +++ b/src/test/java/snippets/SnippetsTests.java @@ -409,7 +409,7 @@ public void union_test() throws Exception { new Integer[]{1, 2, 4} ); - assertThat(union).isEqualTo(new Integer[]{1, 2, 3, 4}); + assertThat(Arrays.stream(union).sorted().toArray()).isEqualTo(new Integer[]{1, 2, 3, 4}); } @Test From 0946266d098d882f9cdaf1b69a437a6f332f050b Mon Sep 17 00:00:00 2001 From: Kishan Kr Sharma Date: Tue, 26 Aug 2025 13:06:49 +0545 Subject: [PATCH 2/3] Flakyness fixed with containsExactlyInAnyOrder --- src/test/java/snippets/SnippetsTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/snippets/SnippetsTests.java b/src/test/java/snippets/SnippetsTests.java index 5e3cfa8..a5a4f37 100644 --- a/src/test/java/snippets/SnippetsTests.java +++ b/src/test/java/snippets/SnippetsTests.java @@ -409,7 +409,7 @@ public void union_test() throws Exception { new Integer[]{1, 2, 4} ); - assertThat(Arrays.stream(union).sorted().toArray()).isEqualTo(new Integer[]{1, 2, 3, 4}); + assertThat(union).containsExactlyInAnyOrder(new Integer[]{1, 2, 3, 4}); } @Test From 459f2a7754143f8ad38722d4ba55e2e5466aa064 Mon Sep 17 00:00:00 2001 From: Kishan Kr Sharma Date: Wed, 27 Aug 2025 14:22:03 +0545 Subject: [PATCH 3/3] .gitignore restored as it was --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index aa8fff1..77576a3 100644 --- a/.gitignore +++ b/.gitignore @@ -38,9 +38,6 @@ buildNumber.properties # CMake cmake-build-debug/ -# .nondex igonre -.nondex - # Mongo Explorer plugin: .idea/**/mongoSettings.xml