Skip to content

Commit

Permalink
Fix RecoverySourceHandlerTests (#79995)
Browse files Browse the repository at this point in the history
Today RecoverySourceHandlerTests#generateFiles can generate files with
different name but same content since the lengths that we use for tests
are small. In order to avoid tripping assertions when we check that two
files are different we should check that the name is different as well
as the content are different.

Closes #79502
Backport of #79546
  • Loading branch information
fcofdez authored Oct 28, 2021
1 parent 19ecd41 commit 1ab16fc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ private boolean containsSnapshotFile(
}

private boolean containsFile(List<StoreFileMetadata> filesMetadata, StoreFileMetadata storeFileMetadata) {
return filesMetadata.stream().anyMatch(f -> f.isSame(storeFileMetadata));
return filesMetadata.stream().anyMatch(f -> f.name().equals(storeFileMetadata.name()) && f.isSame(storeFileMetadata));
}

private boolean containsFile(List<StoreFileMetadata> files, String fileName, long length) {
Expand Down

0 comments on commit 1ab16fc

Please sign in to comment.