From a9712de8fbd53c2adbc9d519e63607e50bad422c Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 21 Nov 2021 16:10:17 -0600 Subject: [PATCH] fix flaky test --- .../snapshot/SnapshotServiceFactoryBeanIntegrationTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotServiceFactoryBeanIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotServiceFactoryBeanIntegrationTest.java index 5716d52d4..7673a9fcc 100644 --- a/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotServiceFactoryBeanIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotServiceFactoryBeanIntegrationTest.java @@ -84,7 +84,10 @@ public void handleArchiveFileLocation() throws Exception { cacheSnapshotZip.getName().replaceAll("\\.", "-")); assertThat(cacheSnapshotZipDirectory.isDirectory(), is(true)); - assertThat(cacheSnapshotZipDirectory.listFiles(FileSystemUtils.FileOnlyFilter.INSTANCE), + File[] expectedSnapshots = cacheSnapshotZipDirectory.listFiles(FileSystemUtils.FileOnlyFilter.INSTANCE); + Arrays.sort(expectedSnapshots, (f1, f2) -> (f1.compareTo(f2))); + Arrays.sort(actualSnapshots, (f1, f2) -> (f1.compareTo(f2))); + assertThat(expectedSnapshots, is(equalTo(actualSnapshots))); } finally {