From 24f8b0f13d6c7bc25b5dd07b09c996f0f3285959 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 18 Aug 2026 12:10:33 +0200 Subject: [PATCH] Halve the file HugeFileDownloadTest transfers The point of the test is a byte count that overflows an int, so the size only has to exceed Integer.MAX_VALUE. It was twice that, which doubled the transfer without widening what the test checks. Dedicated runs of the class: 29.98s before, 5.47s and 5.50s after. --- .../maven/wagon/providers/http/HugeFileDownloadTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java index 90f1edad..f3932650 100644 --- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java +++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java @@ -55,9 +55,12 @@ public class HugeFileDownloadTest { private static final Logger LOGGER = LoggerFactory.getLogger(HugeFileDownloadTest.class); - private static final long HUGE_FILE_SIZE = - Integer.valueOf(Integer.MAX_VALUE).longValue() - + Integer.valueOf(Integer.MAX_VALUE).longValue(); + /** + * Just past the 2 GiB mark, which is what this test is about: a byte count held in an int + * overflows above Integer.MAX_VALUE. Twice that only doubles the transfer without widening + * the range of the check. + */ + private static final long HUGE_FILE_SIZE = Integer.MAX_VALUE + 1024L; private static String getBasedir() { String basedir = System.getProperty("basedir");