Skip to content

Commit 50fba7c

Browse files
Disable ReadingOfLockedDataFiles test
1 parent 62764df commit 50fba7c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/ICSharpCode.SharpZipLib.Tests/Zip/ZipTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,21 @@ public void ExtractExceptions()
27532753

27542754
[Test]
27552755
[Category("Zip")]
2756+
[Ignore("see comments below")]
2757+
/*
2758+
* This test is somewhat strange:
2759+
* a) It tries to simulate a locked file by opening it on the same thread using FileShare.
2760+
* However the FileShare value is not meant for cross-process file locking, but only to
2761+
* allow other threads in the same process to access the same file.
2762+
* This is not the intended behavior, you would need a second process locking the file
2763+
* when running this test.
2764+
* b) It would require to change the file operation in FastZip.ProcessFile to use FileShare.ReadWrite
2765+
* but doing so would make FastZip work with locked files (that are potentially written to by others)
2766+
* and silently ignoring any locks. HOWEVER: This can lead to corrupt/incomplete files, which is why it
2767+
* should not be the default behavior.
2768+
*
2769+
* Therefore I would remove this test.
2770+
**/
27562771
public void ReadingOfLockedDataFiles()
27572772
{
27582773
const string tempName1 = "a.dat";

0 commit comments

Comments
 (0)