You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/08/18 11:18:36 UTC
(maven-wagon) branch wagon-3.x updated: Halve the file HugeFileDownloadTest transfers
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch wagon-3.x
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git
The following commit(s) were added to refs/heads/wagon-3.x by this push:
new 3fca786f Halve the file HugeFileDownloadTest transfers
3fca786f is described below
commit 3fca786f7ca0435191f67913600faec88a62f668
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Aug 18 13:12:31 2026 +0200
Halve the file HugeFileDownloadTest transfers
Backport of the same change on master; this branch's copy was identical
to master's before it.
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 on this branch: 12.70s before, 5.08s after.
---
.../apache/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");