Skip to content

[Bug]: Intl.getCanonicalLocales tests fail on Windows Server 2022 due to mismatch ICU version #7059

@QuellaZhang

Description

@QuellaZhang

ChakraCore Version

97e68c9

Steps to reproduce

  • git clone https://github.com/microsoft/ChakraCore C:\gitP\microsoft\ChakraCore
  • cd /d C:\gitP\microsoft\ChakraCore
  • msbuild /m /p:Platform=x64 /p:Configuration=Test /p:WindowsTargetPlatformVersion=10.0.22621.0 Build\Chakra.Core.sln /t:Rebuild
  • cd /d C:\gitP\microsoft\ChakraCore\test
  • cmd.exe /c ver
  • python runtests.py -t --x64

Proof of concept

if (WScript.Platform.ICU_VERSION < 62) {
...
} else {
...
}

Exception or Error

[757/2600 0.16] Failed -> Intl\GetCanonicalLocales.js
C:\gitP\microsoft\ChakraCore\Build\VcBuild\bin\x64_Test\ch.exe -ExtendedErrorStackForTestHost -BaselineMode -WERExceptionSupport -maxInterpretCount:1 -maxSimpleJitRunCount:1 -bgjit- -dynamicprofilecache:profile.dpl.1105 -args summary -endargs C:\gitP\microsoft\ChakraCore\test\Intl\GetCanonicalLocales.js

Output:
----------------------------
ICU_VERSION = 64
de-DE-u-co-yes-kn-true
*** Running test #1 (0): Intl.getCanonicalLocales Functionality (according to ECMA 402 #sec-canonicalizelocalelist)
Test threw exception: assert.areEqual failed at (GetCanonicalLocales.js:102:17):
  expected: de-DE-u-co-kn
    actual: de-DE-u-co-yes-kn-true
   
FAILED
*** Running test #2 (1): Handling of unsupported tags and subtags (general canonicalization)
Test threw exception: assert.areEqual failed at (GetCanonicalLocales.js:139:17):
  expected: xx-ZZ-u-yy-zz
    actual: xx-ZZ-u-yy-yes-zz-yes
   
FAILED
Summary of tests: total executed: 11; passed: 9; failed: 2

Additional Context

We build Chakra using the latest MSVC to detect compiler regressions. After updating the SHA to 97e68c9, we observed that Chakra test exhibited different behaviors on CI test VMs compared to local test VMs. The root cause was conclusively identified as differences in the Windows and ICU versions.

Environment:
CI VM:

  • OS: Windows Server 2022 (10.0.20348)
  • ICU_VERSION: 64
  • Intl.getCanonicalLocales Output: "de-DE-u-co-yes-kn-true"
  • Chakra test result: 2 tests failed

Local VM:

  • OS: Windows 11 (10.0.22631)
  • ICU_VERSION: 68
  • Intl.getCanonicalLocales Output: "de-DE-u-co-kn"
  • Chakra test result: All passed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions