fix the windows test failures from crlf converted resources and a directory that cannot deny removal
What changed, and why it matters
This commit fixes automated test failures that only happen on Windows. It tells Git not to alter line endings in test resource files, updates a linked library (drongo), and skips one test on Windows because Windows cannot make a directory undeletable in the way the test expects. There is no user-facing security issue or vulnerability here.
No security action needed. Treat as routine test-fix/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a test-only/maintenance patch. .gitattributes marks src/test/resources/** as -text to prevent CRLF conversion on Windows. The drongo submodule is bumped to 080cf3f7cf74133ba68b369065d0f2e7ea4337da. HeaderStoreTest.java imports OsType and assumeFalse, then skips loadsAStoreThatCannotBeDeleted() on Windows because setWritable(false) is refused on directories and the read-only attribute does not prevent deletion. No production code behavior is changed.
Changed components
src/test/resources/** (Git line-ending handling)drongo submodulesrc/test/java/com/sparrowwallet/sparrow/net/HeaderStoreTest.javaInspect captured patch +7 / −1
### .gitattributes
@@ -0,0 +1 @@
+src/test/resources/** -text
### drongo
@@ -1 +1 @@
-Subproject commit b36afb730923e212eb9a1c3a998a22904edef0ec
+Subproject commit 080cf3f7cf74133ba68b369065d0f2e7ea4337da
### src/test/java/com/sparrowwallet/sparrow/net/HeaderStoreTest.java
@@ -1,6 +1,7 @@
package com.sparrowwallet.sparrow.net;
import com.sparrowwallet.drongo.Network;
+import com.sparrowwallet.drongo.OsType;
import com.sparrowwallet.drongo.protocol.BlockHeader;
import com.sparrowwallet.drongo.protocol.HeaderCheckpoints;
import com.sparrowwallet.drongo.protocol.Sha256Hash;
@@ -27,6 +28,7 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
/**
* The header store on regtest, whose trivial proof of work target is the only one a synthetic chain can be mined against, and whose empty checkpoints
@@ -244,6 +246,9 @@ public void discardsAStoreThatDoesNotDescendFromTheAnchor() throws IOException {
*/
@Test
public void loadsAStoreThatCannotBeDeleted() throws IOException {
+ //Windows has no way to deny the removal: setWritable(false) is refused on a directory, and the read only attribute would not stop a delete in any case
+ assumeFalse(OsType.getCurrent() == OsType.WINDOWS);
+
BlockHeader foreign = new BlockHeader(1, Sha256Hash.wrap("00000000000000000000000000000000000000000000000000000000deadbeef"),
Sha256Hash.ZERO_HASH, null, 1600000000L, 0x207fffffL, 0);
writeStoreFile("1", List.of(foreign));Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.