Skip to content

Commit 8ba390d

Browse files
committed
8261753: Test java/lang/System/OsVersionTest.java still failing on BigSur patch versions after JDK-8253702
Reviewed-by: rriggs
1 parent 16bd7d3 commit 8ba390d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/jdk/java/lang/System/OsVersionTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015 SAP SE. All rights reserved.
2+
* Copyright (c) 2015, 2021, SAP SE. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
import jdk.test.lib.Platform;
2525
import jdk.test.lib.process.OutputAnalyzer;
2626
import jdk.test.lib.process.ProcessTools;
27+
import jtreg.SkippedException;
2728

2829
/*
2930
* @test
@@ -49,8 +50,14 @@ public static void main(String args[]) throws Throwable {
4950
}
5051
else if (Platform.isOSX()) {
5152
OutputAnalyzer output = ProcessTools.executeProcess("sw_vers", "-productVersion");
52-
if (!osVersion.equals(output.getOutput().trim())) {
53-
throw new Error(osVersion + " != " + output.getOutput().trim());
53+
String swVersOutput = output.getOutput().trim();
54+
if (!osVersion.equals(swVersOutput)) {
55+
// This section can be removed if minimum build SDK is xcode 12+
56+
if (swVersOutput.startsWith(osVersion)) {
57+
throw new SkippedException("MacOS version only matches in parts, this is expected when " +
58+
"JDK was built with Xcode < 12 and MacOS version patch is > 0");
59+
}
60+
throw new Error(osVersion + " != " + swVersOutput);
5461
}
5562
}
5663
else if (Platform.isAix()) {

0 commit comments

Comments
 (0)