-
Notifications
You must be signed in to change notification settings - Fork 31k
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
test-module-loading-error fails on Windows with MUI set to a non-English language #13376
Comments
IMO, we shouldn't be matching on operating system error messages in our code. The problem you're facing here is an excellent reason why. In this particular case, it's not like all the variants we're accepting are consistent anyway. "Not a valid application" vs. "file too short" vs. "exec file format error" vs. "unknown file type"... At this point, why not just accept any error message as long as there's an error? I think it would be acceptable to remove the message string checking entirely in this test. |
There is a way to change the locale of the process or even just a thread.
Looking at this I'm pro (3). |
I'm fine with any of the 3 options proposed. |
(1) sounds fine to me, even though there are a few paranoid reasons not to do it (e.g. if someone deletes the fixture file, the test would still pass). (2) sounds non-trivial. How would you change the locale for the particular thread? Wouldn't we need either an additional native binding or to integrate that logic into node itself? I know that a process can change its own locale, but I had hoped for a solution to integrate into the test runner instead of the node process. (3) sounds good to me as long as no other complaints about the handling of error messages on other platforms come up. Note that my system reports
|
By skip you mean "accept any error" right? If so that seems reasonable. |
>powershell -NoProfile -ExecutionPolicy Unrestricted -c "(Get-UICulture).TwoLetterISOLanguageName"
en Reference:
@tniessen can you confirm powershell snippet? |
Cross-ref to fix: #13393 |
Thanks, did not find anything similar :) Yes, |
👍 |
PR-URL: nodejs#13393 Fixes: nodejs#13376 Reviewed-By: Tobias Nießen <[email protected]>
PR-URL: #13393 Fixes: #13376 Reviewed-By: Tobias Nießen <[email protected]>
On Windows, error messages are translated to the user's primary language as determined by the Windows MUI, so
does not match the error message. This results in the test case failing like this:
I didn't find a way to change the language settings for a single process / process tree. I added my localized error message to
test/parallel/test-module-loading-error.js
to suppress the error, but I got tired of doing that every time I cloned the repo. I switched to ignoring the error, knowing that the cause was localization, but I would prefer a clean solution (e.g. the early failure prevents the other tests in the file to be executed). Finally, I changed the primary system language to en-US to get rid of the test failure.@nodejs/testing Any ideas on how to tackle this problem, except ignoring it or changing the system language?
The text was updated successfully, but these errors were encountered: