Skip to content

Commit

Permalink
Fix flakyness in SmallFileBackupIntegrationTest again
Browse files Browse the repository at this point in the history
Since the chunk gets zipped, the random input data would sometimes differ in size if randomness wasn't truly random, so it could be compressed more.
  • Loading branch information
grote committed Apr 5, 2024
1 parent fef6ecc commit 2bfbd1a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ internal class SmallFileBackupIntegrationTest {
it.copy(lastSeen = cachedFile2.lastSeen) == cachedFile2
})
} just Runs
coEvery { observer.onFileBackedUp(file2, true, 0, 181, "S") } just Runs
coEvery {
observer.onFileBackedUp(file2, true, 0, match<Long> { it <= outputStream2.size() }, "S")
} just Runs

val result = smallFileBackup.backupFiles(files, availableChunkIds, observer)
assertEquals(setOf(chunkId.toHexString()), result.chunkIds)
Expand All @@ -114,7 +116,7 @@ internal class SmallFileBackupIntegrationTest {
assertEquals(0, result.backupMediaFiles.size)

coVerify {
observer.onFileBackedUp(file2, true, 0, 181, "S")
observer.onFileBackedUp(file2, true, 0, match<Long> { it <= outputStream2.size() }, "S")
}
}

Expand Down

0 comments on commit 2bfbd1a

Please sign in to comment.