Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ public void EncryptDecrypt_Read()
Assert.Equal(fileContentRead, File.ReadAllText(tmpFileName));
Assert.Equal(FileAttributes.Encrypted, (FileAttributes.Encrypted & File.GetAttributes(tmpFileName)));

File.Decrypt(tmpFileName);
// Sometimes Decrypt will fail with, eg.,
// System.IO.IOException : The process cannot access the file '...' because it is being used by another process.
// Assumption is that it just needs a little more time
RetryHelper.Execute(() =>
{
File.Decrypt(tmpFileName);
}, maxAttempts: 30, backoffFunc: null, retryWhen: e => e.GetType() == typeof(IOException));
Comment thread
danmoseley marked this conversation as resolved.

Assert.Equal(fileContentRead, File.ReadAllText(tmpFileName));
Assert.NotEqual(FileAttributes.Encrypted, (FileAttributes.Encrypted & File.GetAttributes(tmpFileName)));
}
Expand Down