Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8261753: Test java/lang/System/OsVersionTest.java still failing on BigSur patch versions after JDK-8253702 #2576

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 SAP SE. All rights reserved.
* Copyright (c) 2015, 2021, SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jtreg.SkippedException;

/*
* @test
@@ -49,8 +50,14 @@ public static void main(String args[]) throws Throwable {
}
else if (Platform.isOSX()) {
OutputAnalyzer output = ProcessTools.executeProcess("sw_vers", "-productVersion");
if (!osVersion.equals(output.getOutput().trim())) {
throw new Error(osVersion + " != " + output.getOutput().trim());
String swVersOutput = output.getOutput().trim();
if (!osVersion.equals(swVersOutput)) {
// This section can be removed if minimum build SDK is xcode 12+
if (swVersOutput.startsWith(osVersion)) {
throw new SkippedException("MacOS version only matches in parts, this is expected when " +
"JDK was built with Xcode < 12 and MacOS version patch is > 0");
}
throw new Error(osVersion + " != " + swVersOutput);
}
}
else if (Platform.isAix()) {
ProTip! Use n and p to navigate between commits in a pull request.