Agreed, how about the changes I just pushed to
https://github.com/apache/httpcomponents-client/pull/571?

On Fri, 23 Aug 2024 at 15:25, Gary D. Gregory <ggreg...@apache.org> wrote:

> On 2024/08/23 13:16:24 Oleg Kalnichevski wrote:
> > On Fri, 2024-08-23 at 13:04 +0000, Gary D. Gregory wrote:
> > > Problem solved: I manually deleted the folder
> > > C:\Users\ggregory\.m2\repository\.cache\download-maven-plugin
> > >
> > > Our clean goal needs to do that...
> > >
> >
> > Andrian,Gary
> >
> > The only proper way of fixing the problem is including the file (or
> > sub-set of it) as a test resource.
>
> I think I like that solution the best because it makes our build
> reproducible.
>
> Gary
>
> >
> > Oleg
> >
> >
> > > Gary
> > >
> > > On 2024/08/23 12:44:28 "Gary D. Gregory" wrote:
> > > > I updated the Maven download plugin to its current version without
> > > > a change in outcome :-(
> > > >
> > > > There must be something odd on my end to get this one test to fail
> > > > but ... what?
> > > >
> > > > TY
> > > > Gary
> > > >
> > > > On 2024/08/23 12:27:43 "Gary D. Gregory" wrote:
> > > > > On 2024/08/23 11:58:54 Adrian Woodhead wrote:
> > > > > > OK, so it's downloaded the file successfully, in this case it's
> > > > > > using a
> > > > > > copy from the plugin's local cache:
> > > > > >
> > > > > > [DEBUG] Got from cache:
> > > > > > C:\Users\ggregory\.m2\repository\.cache\download-maven-
> > > > > > plugin\effective_tld_names.dat_21b8d15562229f61c11725080a5f7911
> > > > > >
> > > > > > Can you confirm that you have this file:
> > > > > >
> > > > > > httpclient5/target/classes/mozilla/public-suffix-list.txt
> > > > >
> > > > > Yes, I have the file:
> > > > >
> > > > > 07-Mar-24  10:24 AM            85,095 public-suffix-list.txt
> > > > >                1 File(s)         85,095 bytes
> > > > >
> > > > >
> > > > > >
> > > > > > ? If so then the problem is most likely related to how the file
> > > > > > is loaded
> > > > > > in the test. Having had a look it's almost certainly on #L44 of
> > > > > > TestPublicSuffixMatcher, can you try change it to:
> > > > > >
> > > > > > private static final String PUBLIC_SUFFIX_LIST_FILE =
> > > > > > String.join(File.separator,  "mozilla", "public-suffix-
> > > > > > list.txt");
> > > > >
> > > > > The test fails just the same :-(
> > > > >
> > > > > FWIW, `Paths.get("mozilla", "public-suffix-list.txt").toString()`
> > > > > would be better here but not really needed unless Paths where
> > > > > used in the test. The "/" does not matter in Java on or off
> > > > > Windows, Java normalizes the path for the platform.
> > > > >
> > > > > The test set up is also problematic because it leaks a file
> > > > > handle. We should be using a try-with-resource here:
> > > > >
> > > > >         // Create a matcher using a custom crafted public suffix
> > > > > list file
> > > > >         try (InputStream in =
> > > > > classLoader.getResourceAsStream(SOURCE_FILE)) {
> > > > >             Assertions.assertNotNull(in);
> > > > >             final List<PublicSuffixList> lists =
> > > > > PublicSuffixListParser.INSTANCE.parseByType(new
> > > > > InputStreamReader(in, StandardCharsets.UTF_8));
> > > > >             matcher = new PublicSuffixMatcher(lists);
> > > > >         }
> > > > >
> > > > > I fixed the above resource leak in git master.
> > > > >
> > > > > The issue remains with the odd test failure on my end though :-(
> > > > >
> > > > > Gary
> > > > >
> > > > > >
> > > > > > and let me know if that fixes your issue? I'm pretty sure it
> > > > > > will. That's
> > > > > > my bad, I haven't used Windows in so long that I just used "/"
> > > > > > as the file
> > > > > > separator. I'll raise an MR with the fix and also change the
> > > > > > exception
> > > > > > thrown when the file cannot be found to be more descriptive.
> > > > > >
> > > > > > On Fri, 23 Aug 2024 at 13:44, Gary D. Gregory
> > > > > > <ggreg...@apache.org> wrote:
> > > > > >
> > > > > > > Hi Andrian:
> > > > > > >
> > > > > > > Here is my output:
> > > > > > >
> https://gist.github.com/garydgregory/071c34698b9b702c8c28efc98e0c526a
> > > > > > >
> > > > > > > Gary
> > > > > > >
> > > > > > > On 2024/08/23 06:57:18 Adrian Woodhead wrote:
> > > > > > > > Strange, what happens if you run mvn with the "-X" flag to
> > > > > > > > get debugging
> > > > > > > > information. I see something along these lines towards the
> > > > > > > > end of the
> > > > > > > build
> > > > > > > > if I've cleaned out "download-maven-plugin" cache to force
> > > > > > > > a fresh
> > > > > > > download:
> > > > > > > >
> > > > > > > > [DEBUG] Loading mojo
> > > > > > > > > com.googlecode.maven-download-plugin:download-maven-
> > > > > > > > > plugin:1.8.1:wget
> > > > > > > from
> > > > > > > > > plugin realm
> > > > > > > > >
> > > > > > > ClassRealm[plugin>com.googlecode.maven-download-
> > > > > > > plugin:download-maven-plugin:1.8.1,
> > > > > > > > > parent:
> > > > > > > > > jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc]
> > > > > > > > > [DEBUG] Configuring mojo execution
> > > > > > > > >
> > > > > > > 'com.googlecode.maven-download-plugin:download-maven-
> > > > > > > plugin:1.8.1:wget:download-public-suffix-list'
> > > > > > > > > with basic configurator -->
> > > > > > > > > [DEBUG]   (f) alwaysVerifyChecksum = false
> > > > > > > > > [DEBUG]   (f) checkSignature = false
> > > > > > > > > [DEBUG]   (f) failOnError = true
> > > > > > > > > [DEBUG]   (f) fileMappers = []
> > > > > > > > > [DEBUG]   (f) followRedirects = true
> > > > > > > > > [DEBUG]   (f) headers = {}
> > > > > > > > > [DEBUG]   (f) insecure = false
> > > > > > > > > [DEBUG]   (f) maxLockWaitTime = 30000
> > > > > > > > > [DEBUG]   (f) outputDirectory =
> > > > > > > > >
> > > > > > > /Users/adrianwoodhead/workspace/httpcomponents-
> > > > > > > client/httpclient5/target/classes/mozilla
> > > > > > > > > [DEBUG]   (f) outputFileName = public-suffix-list.txt
> > > > > > > > > [DEBUG]   (f) preemptiveAuth = false
> > > > > > > > > [DEBUG]   (f) readTimeOut = 3000
> > > > > > > > > [DEBUG]   (f) retries = 2
> > > > > > > > > [DEBUG]   (f) runOnlyAtRoot = false
> > > > > > > > > [DEBUG]   (f) session =
> > > > > > > > > org.apache.maven.execution.MavenSession@5793b87
> > > > > > > > > [DEBUG]   (f) skip = false
> > > > > > > > > [DEBUG]   (f) skipCache = false
> > > > > > > > > [DEBUG]   (f) unpack = false
> > > > > > > > > [DEBUG]   (f) uri =
> > > > > > > https://publicsuffix.org/list/effective_tld_names.dat
> > > > > > > > > [DEBUG] -- end configuration --
> > > > > > > > > [DEBUG] Got settings
> > > > > > > > > [DEBUG] Cache is:
> > > > > > > > > /Users/adrianwoodhead/.m2/repository/.cache/download-
> > > > > > > > > maven-plugin
> > > > > > > > > [DEBUG] No checksums were supplied, skipping file
> > > > > > > > > validation
> > > > > > > > > [INFO] Downloading:
> > > > > > > https://publicsuffix.org/list/effective_tld_names.dat
> > > > > > > > > [INFO] 274/?
> > > > > > > > > [INFO] 1365/?
> > > > > > > > > [INFO] 2756/?
> > > > > > > > > [INFO] 3146/?
> > > > > > > > >
> > > > > > > > .....
> > > > > > > >
> > > > > > > > > [INFO] 312902/?
> > > > > > > > > [INFO] 314234/?
> > > > > > > > > [INFO] 314896/?
> > > > > > > > > [INFO] 315020/?
> > > > > > > > > [INFO] downloaded 315020
> > > > > > > > > [INFO]
> > > > > > > > >
> > > > > > > -------------------------------------------------------------
> > > > > > > -----------
> > > > > > > > > [INFO] BUILD SUCCESS
> > > > > > > > > [INFO]
> > > > > > > > >
> > > > > > > -------------------------------------------------------------
> > > > > > > -----------
> > > > > > > >
> > > > > > > >
> > > > > > > > I'd be curious to see what the values are for
> > > > > > > > "outputDirectory" and what
> > > > > > > > error message you get (if any). If there isn't an error we
> > > > > > > > can try figure
> > > > > > > > out where the file is getting downloaded to and then if we
> > > > > > > > need to adjust
> > > > > > > > the test to look for this in some other way.
> > > > > > > >
> > > > > > > > On Fri, 23 Aug 2024 at 00:18, Gary D. Gregory
> > > > > > > > <ggreg...@apache.org>
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Hello Adrian,
> > > > > > > > >
> > > > > > > > > From the httpclient5 directory, I ran
> > > > > > > > >
> > > > > > > > > mvn clean generate-resources && mvn package
> > > > > > > > >
> > > > > > > > > and it failed just the same :-(
> > > > > > > > >
> > > > > > > > > I wonder what's special about my setup unless it's an
> > > > > > > > > edge case...
> > > > > > > > >
> > > > > > > > > Gary
> > > > > > > > >
> > > > > > > > > On 2024/08/22 21:04:45 Adrian Woodhead wrote:
> > > > > > > > > > I'll have a proper look tomorrow but I ran "mvn
> > > > > > > > > > generate-resources"
> > > > > > > from
> > > > > > > > > > the "httpclient5" folder, not the top-level project
> > > > > > > > > > root and it
> > > > > > > worked
> > > > > > > > > for
> > > > > > > > > > me if I then did "mvn package". Does that work for you
> > > > > > > > > > or does it
> > > > > > > also
> > > > > > > > > fail?
> > > > > > > > > >
> > > > > > > > > > On Thu, 22 Aug 2024 at 18:52, Gary Gregory
> > > > > > > > > > <garydgreg...@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > > > On Thu, Aug 22, 2024 at 8:58 AM Oleg Kalnichevski <
> > > > > > > ol...@apache.org>
> > > > > > > > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Thu, 2024-08-22 at 08:26 -0400, Gary Gregory
> > > > > > > > > > > > wrote:
> > > > > > > > > > > > > Hm, running `mvn clean generate-resources`didn't
> > > > > > > > > > > > > help. My git
> > > > > > > repo
> > > > > > > > > is
> > > > > > > > > > > > > clean
> > > > > > > > > > > > > after running the command.
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Feel free to contact the original contributor of
> > > > > > > > > > > > the test case:
> > > > > > > > > > > >
> > > > > > > > > > > >
> https://github.com/apache/httpcomponents-client/pull/566
> > > > > > > > > > >
> > > > > > > > > > > Thank you for the link, Oleg. I commented there.
> > > > > > > > > > >
> > > > > > > > > > > Gary
> > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Oleg
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > > Gary
> > > > > > > > > > > > >
> > > > > > > > > > > > > On Thu, Aug 22, 2024, 5:02 AM Oleg Kalnichevski <
> > > > > > > ol...@apache.org>
> > > > > > > > > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > On Wed, 2024-08-21 at 18:48 -0400, Gary Gregory
> > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > > Ah, I see the comment in out GH GI file. How
> > > > > > > > > > > > > > > about marking
> > > > > > > a
> > > > > > > > > > > > > > > Windows
> > > > > > > > > > > > > > > build
> > > > > > > > > > > > > > > with the experimental flag? Would anyone mind
> > > > > > > > > > > > > > > that?
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > I doubt this issue is Windows / OS specific.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Please run `mvn clean generate-resources` to
> > > > > > > > > > > > > > ensure the
> > > > > > > latest
> > > > > > > > > > > > > > public
> > > > > > > > > > > > > > suffix list file got downloaded from the
> > > > > > > > > > > > > > Mozilla site and
> > > > > > > see if
> > > > > > > > > > > > > > that
> > > > > > > > > > > > > > solves the problem.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Oleg
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Gary
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On Wed, Aug 21, 2024, 6:12 PM Gary D. Gregory
> > > > > > > > > > > > > > > <ggreg...@apache.org>
> > > > > > > > > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > With the HEAD of git master, I get:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > [INFO]
> > > > > > > > > -------------------------------------------------------
> > > > > > > > > > > > > > > > [INFO]  T E S T S
> > > > > > > > > > > > > > > > [INFO]
> > > > > > > > > -------------------------------------------------------
> > > > > > > > > > > > > > > > [INFO] Running
> > > > > > > > > > > > > > > > org.apache.hc.client5.http.psl.TestPublicSu
> > > > > > > > > > > > > > > > ffixMatcher
> > > > > > > > > > > > > > > > [ERROR] Tests run: 6, Failures: 1, Errors:
> > > > > > > > > > > > > > > > 0, Skipped: 0,
> > > > > > > > > Time
> > > > > > > > > > > > > > > > elapsed:
> > > > > > > > > > > > > > > > 0.944 s <<< FAILURE! - in
> > > > > > > > > > > > > > > > org.apache.hc.client5.http.psl.TestPublicSu
> > > > > > > > > > > > > > > > ffixMatcher
> > > > > > > > > > > > > > > > [ERROR]
> > > > > > > > > > > > > > > >
> > > > > > > > > org.apache.hc.client5.http.psl.TestPublicSuffixMatcher.te
> > > > > > > > > stGetD
> > > > > > > > > > > > > > > > omai
> > > > > > > > > > > > > > > > nRootPublicSuffixList
> > > > > > > > > > > > > > > > Time elapsed: 0.019 s  <<< FAILURE!
> > > > > > > > > > > > > > > > org.opentest4j.AssertionFailedError:
> > > > > > > > > > > > > > > > expected: <null> but
> > > > > > > > > was:
> > > > > > > > > > > > > > > > <uk.com>
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.AssertionFailureBuilder.build(Asser
> > > > > > > > > tionFa
> > > > > > > > > > > > > > > > ilur
> > > > > > > > > > > > > > > > eBuilder.java:151)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.AssertionFailureBuilder.buildAndThr
> > > > > > > > > ow(Ass
> > > > > > > > > > > > > > > > erti
> > > > > > > > > > > > > > > > onFailureBuilder.java:132)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEqu
> > > > > > > > > als.ja
> > > > > > > > > > > > > > > > va:1
> > > > > > > > > > > > > > > > 97)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.AssertEquals.assertEquals(AssertEqu
> > > > > > > > > als.ja
> > > > > > > > > > > > > > > > va:1
> > > > > > > > > > > > > > > > 82)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.AssertEquals.assertEquals(AssertEqu
> > > > > > > > > als.ja
> > > > > > > > > > > > > > > > va:1
> > > > > > > > > > > > > > > > 77)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.junit.jupiter.api.Assertions.assertEquals(Assertions.
> > > > > > > > > java:1
> > > > > > > > > > > > > > > > 145)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.apache.hc.client5.http.psl.TestPublicSuffixMatcher.ch
> > > > > > > > > eckPub
> > > > > > > > > > > > > > > > licS
> > > > > > > > > > > > > > > > uffix(TestPublicSuffixMatcher.java:171)
> > > > > > > > > > > > > > > >         at
> > > > > > > > > > > > > > > >
> > > > > > > > > org.apache.hc.client5.http.psl.TestPublicSuffixMatcher.te
> > > > > > > > > stGetD
> > > > > > > > > > > > > > > > omai
> > > > > > > > > > > > > > > > nRootPublicSuffixList(TestPublicSuffixMatch
> > > > > > > > > > > > > > > > er.java:208)
> > > > > > > > > > > > > > > >         at
> > > > > > > java.lang.reflect.Method.invoke(Method.java:498)
> > > > > > > > > > > > > > > >         at
> > > > > > > java.util.ArrayList.forEach(ArrayList.java:1259)
> > > > > > > > > > > > > > > >         at
> > > > > > > java.util.ArrayList.forEach(ArrayList.java:1259)
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Running on:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Apache Maven 3.9.8
> > > > > > > (36645f6c9b5079805ea5009217e36f2cffd34256)
> > > > > > > > > > > > > > > > Maven home: C:\java\apache-maven-3.9.8
> > > > > > > > > > > > > > > > Java version: 17.0.12, vendor: Eclipse
> > > > > > > > > > > > > > > > Adoptium, runtime:
> > > > > > > > > > > > > > > > C:\Program
> > > > > > > > > > > > > > > > Files\Eclipse Adoptium\jdk-17.0.12.7-
> > > > > > > > > > > > > > > > hotspot
> > > > > > > > > > > > > > > > Default locale: en_US, platform encoding:
> > > > > > > > > > > > > > > > Cp1252
> > > > > > > > > > > > > > > > OS name: "windows 10", version: "10.0",
> > > > > > > > > > > > > > > > arch: "amd64",
> > > > > > > > > family:
> > > > > > > > > > > > > > > > "windows"
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > What do you think about adding a Windows
> > > > > > > > > > > > > > > > build to GitHub
> > > > > > > CI.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Gary
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > ---------------------------------------------------------
> > > > > > > > > ------
> > > > > > > > > > > > > > > > ----
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > > > > dev-unsubscr...@hc.apache.org
> > > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > > > > dev-h...@hc.apache.org
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > ---------------------------------------------------------
> > > > > > > > > ----------
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > > > dev-unsubscr...@hc.apache.org
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > > > dev-h...@hc.apache.org
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > -------------------------------------------------------------
> > > > > > > --------
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > dev-unsubscr...@hc.apache.org
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > dev-h...@hc.apache.org
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > -------------------------------------------------------------
> > > > > > > --------
> > > > > > > > > > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > dev-h...@hc.apache.org
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > ---------------------------------------------------------
> > > > > > > > > ------------
> > > > > > > > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > > > > > > > For additional commands, e-mail: dev-h...@hc.apache.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > -------------------------------------------------------------
> > > > > > > --------
> > > > > > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > > > > > For additional commands, e-mail: dev-h...@hc.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > > -----------------------------------------------------------------
> > > > > ----
> > > > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > > > For additional commands, e-mail: dev-h...@hc.apache.org
> > > > >
> > > > >
> > > >
> > > > -------------------------------------------------------------------
> > > > --
> > > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > > For additional commands, e-mail: dev-h...@hc.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > > For additional commands, e-mail: dev-h...@hc.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> > For additional commands, e-mail: dev-h...@hc.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
> For additional commands, e-mail: dev-h...@hc.apache.org
>
>

Reply via email to