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
[SR-9985] TestNSNumber.test_descriptionWithLocale failing on Swift 5.0 AArch64 #3526
Comments
What version of ICU are you using? Is it building it as part of the swift build? |
As far as I can see it is version ICU4C and it is part of the swift build. |
Tested new build of swift-4.2-branch and TestNSNumber.test_descriptionWithLocale is now failing. Test Case 'TestNSNumber.test_descriptionWithLocale' started at 2019-02-23 13:16:22.710
TestFoundation/TestNSNumber.swift:1104: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1000") is not equal to ("1,000") -
TestFoundation/TestNSNumber.swift:1109: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-32768") is not equal to ("-32,768") -
TestFoundation/TestNSNumber.swift:1110: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("32767") is not equal to ("32,767") -
TestFoundation/TestNSNumber.swift:1111: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-2147483648") is not equal to ("-2,147,483,648") -
TestFoundation/TestNSNumber.swift:1112: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("2147483647") is not equal to ("2,147,483,647") -
TestFoundation/TestNSNumber.swift:1113: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-9223372036854775808") is not equal to ("-9,223,372,036,854,775,808") -
TestFoundation/TestNSNumber.swift:1114: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("9223372036854775807") is not equal to ("9,223,372,036,854,775,807") -
TestFoundation/TestNSNumber.swift:1119: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("65535") is not equal to ("65,535") -
TestFoundation/TestNSNumber.swift:1121: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("4294967295") is not equal to ("4,294,967,295") -
TestFoundation/TestNSNumber.swift:1129: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1e+09") is not equal to ("1E+09") -
TestFoundation/TestNSNumber.swift:1132: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("nan") is not equal to ("NaN") -
TestFoundation/TestNSNumber.swift:1133: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1.175494e-38") is not equal to ("1.175494E-38") -
TestFoundation/TestNSNumber.swift:1134: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1.401298e-45") is not equal to ("1.401298E-45") -
TestFoundation/TestNSNumber.swift:1135: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("3.402823e+38") is not equal to ("3.402823E+38") -
TestFoundation/TestNSNumber.swift:1139: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1000000000") is not equal to ("1,000,000,000") -
TestFoundation/TestNSNumber.swift:1142: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("nan") is not equal to ("NaN") -
TestFoundation/TestNSNumber.swift:1149: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1000") is not equal to ("1.000") -
TestFoundation/TestNSNumber.swift:1154: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-32768") is not equal to ("-32.768") -
TestFoundation/TestNSNumber.swift:1155: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("32767") is not equal to ("32.767") -
TestFoundation/TestNSNumber.swift:1156: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-2147483648") is not equal to ("-2.147.483.648") -
TestFoundation/TestNSNumber.swift:1157: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("2147483647") is not equal to ("2.147.483.647") -
TestFoundation/TestNSNumber.swift:1158: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("-9223372036854775808") is not equal to ("-9.223.372.036.854.775.808") -
TestFoundation/TestNSNumber.swift:1159: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("9223372036854775807") is not equal to ("9.223.372.036.854.775.807") -
TestFoundation/TestNSNumber.swift:1164: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("65535") is not equal to ("65.535") -
TestFoundation/TestNSNumber.swift:1166: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("4294967295") is not equal to ("4.294.967.295") -
TestFoundation/TestNSNumber.swift:1174: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1e+09") is not equal to ("1E+09") -
TestFoundation/TestNSNumber.swift:1178: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("nan") is not equal to ("NaN") -
TestFoundation/TestNSNumber.swift:1179: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1,175494e-38") is not equal to ("1,175494E-38") -
TestFoundation/TestNSNumber.swift:1180: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1,401298e-45") is not equal to ("1,401298E-45") -
TestFoundation/TestNSNumber.swift:1181: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("3,402823e+38") is not equal to ("3,402823E+38") -
TestFoundation/TestNSNumber.swift:1184: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("1000000000") is not equal to ("1.000.000.000") -
TestFoundation/TestNSNumber.swift:1187: error: TestNSNumber.test_descriptionWithLocale : XCTAssertEqual failed: ("nan") is not equal to ("NaN") -
Test Case 'TestNSNumber.test_descriptionWithLocale' failed (0.008 seconds) Also this is failing Test Case 'TestNSString.test_initializeWithFormat3' started at 2019-02-23 13:16:26.238
TestFoundation/TestNSString.swift:838: error: TestNSString.test_initializeWithFormat3 : XCTAssertEqual failed: ("en_GB value is 1000 (42.0)") is not equal to ("en_GB value is 1,000 (42.0)") -
TestFoundation/TestNSString.swift:844: error: TestNSString.test_initializeWithFormat3 : XCTAssertEqual failed: ("de_DE value is 1000 (42,0)") is not equal to ("de_DE value is 1.000 (42,0)") -
Test Case 'TestNSString.test_initializeWithFormat3' failed (0.001 seconds) |
Build on master with PR #1866 is running now. |
All tests are passing on the master 😃 with PR #1866 --- Running tests for foundation ---
--- test ---
+ /usr/local/bin/cmake --build /home/worksonarm_test/jenkins_slave/workspace/swift-master-aarch64-test/build/buildbot_linux/foundation-linux-aarch64 -- -j96 test
[0/1][ 0%][0.000s] Running tests...
Test project /home/worksonarm_test/jenkins_slave/workspace/swift-master-aarch64-test/build/buildbot_linux/foundation-linux-aarch64
Start 1: TestFoundation
1/1 Test #​1: TestFoundation ................... Passed 45.67 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 45.68 sec
-- test finished --
--- Finished tests for foundation --- |
What about the |
Tested swift-5.0-branch with PR #1866 and 'TestNSNumber.test_descriptionWithLocale' and 'TestNSString.test_initializeWithFormat3' are still failing. |
There isnt any difference between master and 5.0 for this code change so Im not sure why it is failing. What build command are you using? Is it using the same build command for both? That PR just checks ICU is a minimum version, which it satisfies. |
Both builds are identical clean builds using the [preset: buildbot_linux] |
I have run foundation tests on new clean builds 2019-02-25 and the results are as follows:- swift-4.2-branch
swift-5.0-branch - with PR #1866
master - with PR #1866
|
I think this may actually be a Could you try running the following test against all three versions, for comparison this is what I see on x86_64 Ubuntu18.04: $ cat locale.swift
import Foundation
print("current locale:", Locale.current.identifier)
print("decimalSeparator:", Locale.current.decimalSeparator ?? "nil")
print("groupingSeparator:", Locale.current.groupingSeparator ?? "nil")
print(String(format: "%d", locale: Locale.current, 123456))
print(String(format: "%0.7g\n", locale: Locale.current, 1234.5678))
let en = Locale(identifier: "en_GB")
print("EN locale:", en.identifier)
print("EN decimalSeparator:", en.decimalSeparator ?? "nil")
print("EN groupingSeparator:", en.groupingSeparator ?? "nil")
print(String(format: "%d", locale: en, 123456))
print(String(format: "%0.7g\n", locale: en, 1234.5678))
let de = Locale(identifier: "de_DE")
print("DE locale:", de.identifier)
print("DE decimalSeparator:", de.decimalSeparator ?? "nil")
print("DE groupingSeparator:", de.groupingSeparator ?? "nil")
print(String(format: "%d", locale: de, 123456))
print(String(format: "%0.7g\n", locale: de, 1234.5678))
$ ~/swift-4.2.2-RELEASE-ubuntu18.04/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123456
1234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123456
1234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123456
1234,568
$ ~/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-19-a-ubuntu18.04/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123,456
1,234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123,456
1,234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123.456
1.234,568
$ ~/swift-DEVELOPMENT-SNAPSHOT-2019-02-19-a-ubuntu18.04/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123,456
1,234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123,456
1,234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123.456
1.234,568 Here, 4.2.2 doesn't use the Locale for some reason but 5.0 and master both match |
[UPDATED]I am not seeing the same results on Ubuntu 16.04 AArch64 neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-4.2-aarch64-RELEASE/install/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123456
1234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123456
1234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123456
1234,568
neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-5.0-aarch64-test/install/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123456
1234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123456
1234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123456
1234,568
neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-master-aarch64/install/usr/bin/swift locale.swift
current locale: en_US
decimalSeparator: .
groupingSeparator: ,
123,456
1,234.568
EN locale: en_GB
EN decimalSeparator: .
EN groupingSeparator: ,
123,456
1,234.568
DE locale: de_DE
DE decimalSeparator: ,
DE groupingSeparator: .
123.456
1.234,568 |
What happens if you run import Foundation
let en = Locale(identifier: "en_GB")
print(String(format: "%d", locale: en, 123456))
print(String(format: "%0.7g\n", locale: en, 1234.5678))
let de = Locale(identifier: "de_DE")
print(String(format: "%d", locale: de, 123456))
print(String(format: "%0.7g\n", locale: de, 1234.5678)) since that is the function used by the |
Here are the results - neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-4.2-aarch64-RELEASE/install/usr/bin/swift locale2.swift
123456
1234.568
123456
1234,568
neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-5.0-aarch64-test/install/usr/bin/swift locale2.swift
123456
1234.568
123456
1234,568
neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-master-aarch64/install/usr/bin/swift locale2.swift
123,456
1,234.568
123.456
1.234,568
neil@swiftyarm:~$ /home/worksonarm_test/jenkins_slave/workspace/swift-5.0-aarch64/install/usr/bin/swift locale2.swift
123456
1234.568
123456
1234,568 |
I have another PR for you to try: it #1897 I believe on ARM64, This PR should get merged into 5.0 at some point anyway but it would be good to get confirmation either way. |
New build of swift-5.0-branch with PR #1897 - all tests passing 👍 — Running tests for foundation —
--- test —
+ /usr/local/bin/cmake --build /home/worksonarm_test/jenkins_slave/workspace/swift-5.0-aarch64-test/build/buildbot_linux/foundation-linux-aarch64 – -j96 test
[0/1] Running tests...
Test project /home/worksonarm_test/jenkins_slave/workspace/swift-5.0-aarch64-test/build/buildbot_linux/foundation-linux-aarch64
Start 1: TestFoundation
1/1 Test #​1: TestFoundation ................... Passed 42.41 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 42.42 sec
– test finished –
— Finished tests for foundation — |
That's good. As one final test could you un-revert the description change to the 4.2 branch and apply #1897 as well and see if thats all working there. Im guessing it will fix it. Also, are you using a 96core ARM server? |
I will try those changes later tonight. Yes, 96cores. It's a Cavium ThunderX from https://www.packet.com/cloud/servers/c1-large-arm/ |
Un-reverted the description change to the 4.2 branch and applied #1897 - Tests now passing. Test Case 'TestNSNumber.test_descriptionWithLocale' started at 2019-02-27 08:37:02.983
Test Case 'TestNSNumber.test_descriptionWithLocale' passed (0.01 seconds)
Test Case 'TestNSString.test_initializeWithFormat3' started at 2019-02-27 08:37:06.468
Test Case 'TestNSString.test_initializeWithFormat3' passed (0.001 seconds) There are still 2 failing tests on 4.2-branch - This has been reported in https://bugs.swift.org/browse/SR-8263 Test Case 'TestNSNumberBridging.testNSNumberBridgeFromInt32' started at 2019-02-27 08:37:03.004
TestFoundation/TestNSNumberBridging.swift:41: error: TestNSNumberBridging.testNSNumberBridgeFromInt32 : failed - TestFoundation/TestNSNumberBridging.swift:235 Optional(2.1474836e+09) != nil Float
TestFoundation/TestNSNumberBridging.swift:41: error: TestNSNumberBridging.testNSNumberBridgeFromInt32 : failed - TestFoundation/TestNSNumberBridging.swift:235 Optional(2.1474836e+09) != nil Float
Test Case 'TestNSNumberBridging.testNSNumberBridgeFromInt32' failed (0.004 seconds)
Test Case 'TestNSNumberBridging.testNSNumberBridgeFromUInt32' started at 2019-02-27 08:37:03.008
TestFoundation/TestNSNumberBridging.swift:41: error: TestNSNumberBridging.testNSNumberBridgeFromUInt32 : failed - TestFoundation/TestNSNumberBridging.swift:274 Optional(4.2949673e+09) != nil Float
TestFoundation/TestNSNumberBridging.swift:41: error: TestNSNumberBridging.testNSNumberBridgeFromUInt32 : failed - TestFoundation/TestNSNumberBridging.swift:274 Optional(4.2949673e+09) != nil Float
Test Case 'TestNSNumberBridging.testNSNumberBridgeFromUInt32' failed (0.002 seconds) 5.0-branch (with #1897) and master are 100% passing. |
So do these two failing tests fail on the current 4.2.2 branch or just the HEAD of swift-4.2-branch ? |
They have been failing since 4.1 maybe before. |
This has been remerged back into the 4.2 branch along with the #1897 fix, could you retest the branch and update this bug when you have a chance? I think it should be fixed for both 4.2 and 5.0 branches now. |
@spevans I have retested and can confirm that this bug is fixed on all branches. |
Environment
Linux Ubuntu 16.04 LTS on AArch64
Additional Detail from JIRA
md5: 5d44a74d8f8f63c16353924e5b1e3d3c
Issue Description:
In Swift 4.2.2 `TestNSNumber.test_descriptionWithLocale` passes.
But in Swift 5.0 `TestNSNumber.test_descriptionWithLocale` fails.
The text was updated successfully, but these errors were encountered: