RFR: 8378702: jdk.test.lib.Platform.isMusl() may return false negative on Alpine Linux
Roger Riggs
rriggs at openjdk.org
Fri Feb 27 16:23:54 UTC 2026
On Fri, 27 Feb 2026 11:32:54 GMT, Frederic Thevenet <fthevenet at openjdk.org> wrote:
>> test/lib/jdk/test/lib/Platform.java line 200:
>>
>>> 198: String l = b.readLine();
>>> 199: return (l != null && l.contains("musl"));
>>> 200: } catch (Exception e) {}
>>
>> Wouldn't it be better to at least print the exception to make it easier to diagnose.
>
> I'm glad you raise that point, because I actually feel the same, especially since printing the exception is the first thing I did when I started investigating the problem.
> But, given that this is how the original code was written, I suspected this might have been done on purpose to avoid polluting the program's output, that some tests parse as part of their operation.
>
> Not sure this is justified; I just opted to minimize the risk of an unfortunate side-effect. But again, I agree better logging would probably have helped catching this way earlier.
The default output stream for is stderr, and will not interfere with stdout used for regular output.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29923#discussion_r2865127401
More information about the core-libs-dev
mailing list